Author Topic: Localization  (Read 826770 times)

Offline Miquel 'Fire' Burns

  • Administrator
  • *****
  • Posts: 1157
  • Programmer
Re: Localization
« Reply #30 on: July 09, 2007, 09:57:10 PM »
There, I fixed it. Don't know what I was doing reading that part of the code in the first place.
"I'm not drunk, just sleep deprived."

m4j3s4

  • Guest
Re: Localization
« Reply #31 on: July 10, 2007, 12:25:30 AM »
Quote
I need your userid on SourceForge. That is where Subversion is hosted for PasswordMaker.
My userid on SourceForge is 1840283 and my username is sjoruam.

Quote
I think we should go with Goofy's suggestion, but I don't really care one way or the other. I like Goofy's suggestion more only because it allows us to use HTML markup in strings. With the solution you propose, we are a little more restricted in the future. I will leave it to you to decide, Mauro.
I have another solution. Instead of changing the DTD file, how about we change "tips.xul" file so that it converts the HTML tags properly?

This is the original code:
Code: [Select]
<script type="application/x-javascript" src="chrome://passwdmaker/content/utils.js"/>

<xul:hbox style="margin: 1em;">
<p>
&tips.001.innerHTML;
<br/><br/>
<ul>
<li>&tips.002.innerHTML;</li><br/>
<li>&tips.003.innerHTML;</li><br/>
<li>&tips.004.innerHTML;</li><br/>
<li>&tips.005.innerHTML;</li><br/>
<li>&tips.006.innerHTML;</li><br/>
<li>&tips.007.innerHTML;</li><br/>
<li>&tips.008.innerHTML;</li>
</ul>
</p>
</xul:hbox>

We can change it like this:
Code: [Select]
<script type="application/x-javascript" src="chrome://passwdmaker/content/tips.js"/>

<xul:hbox style="margin: 1em;">
<p>
<span id="001">&tips.001.innerHTML;</span>
<br/><br/>
<ul>
<li id="002">&tips.002.innerHTML;</li><br/>
<li id="003">&tips.003.innerHTML;</li><br/>
<li id="004">&tips.004.innerHTML;</li><br/>
<li id="005">&tips.005.innerHTML;</li><br/>
<li id="006">&tips.006.innerHTML;</li><br/>
<li id="007">&tips.007.innerHTML;</li><br/>
<li id="008">&tips.008.innerHTML;</li>
</ul>
</p>
<script language="javascript">
document.getElementById("001").innerHTML = decodeHTML(document.getElementById("001").innerHTML);
document.getElementById("002").innerHTML = decodeHTML(document.getElementById("002").innerHTML);
document.getElementById("003").innerHTML = decodeHTML(document.getElementById("003").innerHTML);
document.getElementById("004").innerHTML = decodeHTML(document.getElementById("004").innerHTML);
document.getElementById("005").innerHTML = decodeHTML(document.getElementById("005").innerHTML);
document.getElementById("006").innerHTML = decodeHTML(document.getElementById("006").innerHTML);
document.getElementById("007").innerHTML = decodeHTML(document.getElementById("007").innerHTML);
document.getElementById("008").innerHTML = decodeHTML(document.getElementById("008").innerHTML);
</script>

Also, we have to create "tips.js" like this:
Code: [Select]
function decodeHTML(html) {
return html.replace(/&lt;/g, "<").replace(/&gt;/g, ">");
}

I tested this solution on Firefox and it works fine.

What do you think?

m4j3s4

  • Guest
Re: Localization
« Reply #32 on: July 10, 2007, 12:33:53 AM »
There's another problem.

The entity tips.008.innerHTML contains an ampersand as one the examples of non-alphanumeric characters and symbols.
I suggest removing it because it is causing trouble when loading "tips.xul".


Offline Eric H. Jung

  • grimholtz
  • Administrator
  • *****
  • Posts: 3353
Re: Localization
« Reply #33 on: July 10, 2007, 02:12:01 AM »
Mauro--you have SVN access now. If you want to change this implementation to your idea or Goofy's or something else, please go ahead.

Here is what I committed to SVN. Please let me know if you think this is OK. This idea is different from both Goofy's and Mauro's. tips.xul is now a thin container for chrome://passwdmaker/locale/character-tips.html. Each locale creates their own locale/**-**/character-tips.html. This is the most flexible and easiest for translators, I think... no?

Code: [Select]
<!-- tips.xul -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://passwdmaker/locale/passwdmaker.dtd">

<dialog
    id="passwordmakeraccountsettings"
    windowtype="passwordmaker"
    title="&tips.window.title;"
    orient="vertical"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    persist="screenX screenY width height">

  <iframe src="chrome://passwdmaker/locale/character-tips.html" flex="1" style="border: 1px black solid"/>
 
</dialog>

Code: [Select]
<!-- chrome://passwdmaker/locale/character-tips.html -->

<style>
  * {
    font-size: x-small;
    font-family: verdana, sans-serif;
  }
  li {
    margin-bottom: 1em;
  } 
  a {
    color: blue;
    cursor: pointer
  }
</style>
<p>
The characters field contains the list of characters used in generating this password.
Here are some tips to follow when selecting characters:
</p>
<ul>
<li>If you require passwords compatible with PasswordMaker 0.6 and before, you must use
0123456789abcdef. If your passwords are missing leading zeros which existed in 0.6,
try using the hash algorithm MD5 Version 0.6 or HMAC-MD5 Version 0.6.</li>
<li>A minimum of two characters is required</li>
<li>Characters can be repeated</li>
<li>Using the same character more than once causes that character to appear more often in the generated password</li>
<li>The more unique characters that are specified, the greater the variety of characters in the generated password</li>
<li>The order of the characters affects what is generated! Using 0123456789abcdef creates different passwords than using abcdef0123456789</li>
<li>You can specify non-English characters like those with
<a href="http://en.wikipedia.org/wiki/Diacritic">diacritical marks</a> (e.g., &#226;, &#229;, &#231;),
<a href="http://en.wikipedia.org/wiki/Diaeresis">diaeresis marks</a>,
(e.g., &#252;, &#228;, &#235;),
<a href="http://en.wikipedia.org/wiki/Ligature_%28typography%29">ligature marks</a>,(e.g., &#198;, &#0339;, &#223;),
non-alphanumeric characters and symbols (e.g., &#169; &#0174; &#8471; !@#$%^&amp;*(){};), etc. If a character you desire does not appear on your keyboard,
don't fret. Most every Western character can be created bytyping ALT-, OPTION-, or CTRL-code key sequences. The key sequences vary by operating system.
For example, typing ALT+0222 in Windows (numbers must be typed on the numeric keypad) yields the Icelandic upper-case Thorn character: &#xfe;.
</li>
</ul>

The only problem is that BabelZilla WTS munges HTML and XHTML files on download. I experienced this with my other extension on BabelZilla (FoxyProxy). I don't really know how to fix this, but it doesn't make sense to me compromise PasswordMaker (or any other extension) for the technical restrictions of BabelZilla.

I am open other suggestions, and welcome changes.

Thank you,
Eric

Offline Goofy

  • Normal Members
  • *
  • Posts: 5
  • Think Global, Make Locales!
Re: Localization
« Reply #34 on: July 10, 2007, 08:09:33 AM »
:) My opinion here

Offline Eric H. Jung

  • grimholtz
  • Administrator
  • *****
  • Posts: 3353
Re: Localization
« Reply #35 on: July 10, 2007, 04:09:16 PM »
Here is what I committed to SVN. Please let me know if you think this is OK. This idea is different from both Goofy's and Mauro's. tips.xul is now a thin container for chrome://passwdmaker/locale/character-tips.html. Each locale creates their own locale/**-**/character-tips.html.

This idea has been discarded in favor of Teo's idea here. I will commit the code to SVN sometime tonight.

m4j3s4

  • Guest
Re: Localization
« Reply #36 on: July 10, 2007, 07:33:33 PM »
Eric, thank you for allow me access do SVN.

As you've chosen Teo's idea and you will commit the new code, I will make no changes to "tips.xul" anymore.

However, the new localized version is not working on Seamonkey. So, I have to debug it on Seamonkey and probably there will a bug fix.

Offline Eric H. Jung

  • grimholtz
  • Administrator
  • *****
  • Posts: 3353
Re: Localization
« Reply #37 on: July 10, 2007, 08:18:38 PM »
If you'd like to commit Teo's idea to SVN, please go ahead.

m4j3s4

  • Guest
Re: Localization
« Reply #38 on: July 10, 2007, 08:42:28 PM »
Ok. So I will commit Teo's idea to SVN after testing in on Firefox.

However, I'm afraid I will not be able to do it today. Maybe tomorrow.

Offline Eric H. Jung

  • grimholtz
  • Administrator
  • *****
  • Posts: 3353
Re: Localization
« Reply #39 on: July 10, 2007, 09:06:08 PM »
Ok. So I will commit Teo's idea to SVN after testing in on Firefox.

However, I'm afraid I will not be able to do it today. Maybe tomorrow.


That is OK. I will submit it back to BabelZilla when you are finished. Thank you!!

m4j3s4

  • Guest
Re: Localization
« Reply #40 on: July 11, 2007, 04:16:58 AM »
I made the changes to pt-BR locale according to Teo's suggestion and commited them to SVN.

However, there're some issues:

1. Clicking on the "Tips" button for the first time with a clean profile, results in a window too small.

    I may debug it to find out how to prevent that.

2. After resizing the window, if we click on a link, it opens the Wikipedia's page inside the iframe, replacing the previous text.

    IMHO, those links are not needed because the text already lists examples of diacritical marks, diaeresis marks and ligature marks.

3. IMHO, the white background doesn't look good on a dialog window.

Teo

  • Guest
Re: Localization
« Reply #41 on: July 11, 2007, 11:57:07 AM »
Mauro,
I tested mine changes on new blank profile on Fx 2.0.0.4 EN and PL version with extension downloaded from BabelZilla and all working properly. Links are opens in new tabs in the browser. See how tips window looks in the English and Polish window.


m4j3s4

  • Guest
Re: Localization
« Reply #42 on: July 11, 2007, 12:56:07 PM »
Ok. You're right, Teo. I made a mistake. I will correct that.

Thank you for replying.

I have a question. Your changes removed the bolds that existed in the original window, as below.


How can we recover that?
« Last Edit: July 11, 2007, 01:23:03 PM by Mauro »

Offline teo951

  • Jr. Member
  • **
  • Posts: 14
Re: Localization
« Reply #43 on: July 11, 2007, 01:33:16 PM »
Straight way by XUL is impossible. We can use the same method as for links, but in this case we have to write some entity more and add style. Bold characters will be in the Fx 3.0 :)
Teo

m4j3s4

  • Guest
Re: Localization
« Reply #44 on: July 11, 2007, 03:02:09 PM »
Well, if Teo's solution drops the bolds, why don't we keep the original code and drop the bolds and the links?
After all, most of the dialog windows I've ever seen contains neither bolds or links.

What do you think?

PasswordMaker Forums

Re: Localization
« Reply #44 on: July 11, 2007, 03:02:09 PM »