Jump to content


Important Announcement!

Please read this post about our new Privacy Policy


Photo
- - - - -

How to test your locale once translated


  • Please log in to reply
18 replies to this topic

#1 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 18 February 2006 - 10:36 AM

NB! Goofy eventually made a more colourful and longer version of this HowTo,
which he published in the Help topic "How to test my locale once translation is done?".

The original HowTo below is somewhat shorter (but not entirely without pictures smile.gif).

Lakrits

--

Currently, it is not possible to automatically rebuild the XPI with your locale via the WTS. So if you want to test your locale you can amend an existing XPI of the add-on menually:
  1. Download the extension (link in the WTS or in the forum topic).
  2. Download your locale folder (zipped in tar.gz) from your language page (link at the top)
  3. Unzip the XPI (7-Zip or PeaZip will do the job; links at the bottom of the post) by first renaming it from filename.xpi to filename.zip, and then unpacking the ZIP file.


  4. Add one locale line in the chrome.manifest file (most common) and/or the install.rdf file (use a text editor, e.g. Notepad++ or Geany, and open the files as any ordinary text file; links at the bottom of the post). You have just to copy-paste the en-US line and modify the language code letters according to your own language. Example for chrome.manifest:

    CODE
    […]
    locale    myaddon en-US jar:chrome/my-addon.jar!/locale/en-US/
    locale    myaddon ar jar:chrome/my-addon.jar!/locale/ar/
    locale    myaddon bg jar:chrome/my-addon.jar!/locale/bg/
    locale    myaddon ca jar:chrome/my-addon.jar!/locale/ca/

    to

    […]
    locale    myaddon en-US jar:chrome/my-addon.jar!/locale/en-US/
    locale    myaddon ar jar:chrome/my-addon.jar!/locale/ar/
    locale    myaddon bg jar:chrome/my-addon.jar!/locale/bg/
    locale    myaddon ca jar:chrome/my-addon.jar!/locale/ca/
    locale    myaddon sv-SE jar:chrome/my-addon.jar!/locale/sv-SE/   <--   your inserted line

  5. Check the maxVersion variable in the install.rdf file, and change its value to a number (absolute or relative, e.g. 22.0b3, 21.0.2, 21.0.* or 21.*, etc.) higher than or equal to your version number of Firefox, Thunderbird or any other program your are testing the add-on on. Example:

    CODE
    (If you e.g. use Firefox version 20.0.1)

    […]
    <em:targetApplication>
        <Description>
            <!-- firefox -->
            <em:id>{an-alphanumeric-series}</em:id>
            <em:minVersion>3.5</em:minVersion>
            <em:maxVersion>4.0b9pre</em:maxVersion>   <--   change this value
        </Description>
    </em:targetApplication>

    to

    […]
    <em:targetApplication>
        <Description>
            <!-- firefox -->
            <em:id>{an-alphanumeric-series}</em:id>
            <em:minVersion>3.5</em:minVersion>
            <em:maxVersion>20.*</em:maxVersion>   <--   now it should work for your FF version
        </Description>
    </em:targetApplication>

  6. Insert your xx or xx-YY locale folder in the "general" locale folder, often-most in (add-on folder)\chrome\locale.



    If the chrome folder contains a JAR file, just unpack that like you did the XPI file, i.e. rename the JAR from filename.jar to filename.zip and unpack as a ZIP archive.


  7. Re-zip everything in proper order:
    a) Repack the contents of the unpacked JAR folder (not the folder you unpacked it to) into a ZIP archive, and rename it from filename.zip to filename.jar.
    b) Delete the unpacked, amended folder (if it's kept it may cause disruptions).
    c) Pack the files and folders (not the folder you unpacked them to) of the main add-on folder into a ZIP archive. Then rename it from filename.zip to filename.xpi.
    d) If you want to keep the original XPI file, just add "_test" to the folder name and "_test.zip" to the archive when you're repacking the add-on.
  8. … and now you can test (on a clean new profile, it is safer)


If one of these steps is difficult for you, just ask on a forum topic, someone will help smile.gif

--

Useful programs for doing these modifications

Text editors:
Geany
Notepad++
Archive managers:
7-Zip
PeaZip
--

Edited by Lakrits, 27 February 2013 - 07:33 PM.
Extended the HowTo with images and provided some additional text.

Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#2 AlleyKat

AlleyKat

    [da-DK] Moderator

  • BabelZillian Mods
  • 271 posts

Posted 18 February 2006 - 02:07 PM

Nice guide Goofy; I thought I'd add mine.

Basic here is Windows (XP).
I hate working in explorer, so I'll use TotalCommander* as an alternative example, and I also here assume that it's set up with an editor that can handle the files.
Characterset can be an issue; for UTF-8 files I use the free TC plugin and file viewer/editor SynPlus. For all other files I use the free Context editor.
*) TC isn't opensource or freeware, but you can use it with a nag screen.

I'll be using Peekko chat as the example in the following.


1) Download the extension and the locale .gz files.


2) Locate the .xpi in TC:



3) Simply Enter or Ctrl-Enter your way into the file (it's automatically treated as a packed archive):



4) If you've set TC to use your favorite editor, simply locate the chrome.manifest and/or install.rdf file(s) and press F4 on it(/them). TC will ask if you want to unpack and edit, answer Yes. In Peekko we only need to change the first. Here's the manifest file:



5) Copy and add a line with your own localization:



6) Save and close the editor. TC will detect this, and ask if it should replace the file in the archive with the edited file, answer Yes.


7) Now we just need to put in the translation itself. Locate the locale folder in the xpi, and open your locale.tar.gz in the other window in TC:



Drag&drop or press F5 to copy the localized folder into the xpi locale folder. Done!

Many plugins have a .jar file with the plugin itself in the chrome-folder - in Total Commander you just press Ctrl-PgDn on the jar file; TC handles the two layers of packed files fine and will just ask you if it should update the .jar file when you leave it again. Ofcourse, answer Yes.


8) Back out of the .xpi and drag it into (t.ex.) Firefox' Extensions window to install. Restart. Test away.


I don't know if this will be useful for anyone, but I hope so.



And my questions:

*) Who am I to ask when I have problems - here in Help, the plugin author or in my own locale group? I have problems testing my own Web Developer translation and am in doubt on some files in Tabbrowser Preferences...

*) Are there any helpful plugins about changing profiles etc. - I've lost my bookmarks and settings before and use both BackupFox, manual backups and bookmark exports, but it's still bothersome to do each time, any 'easy' solutions? biggrin.gif


Yep, born lazy and will remain so...

[ edit ] added comment on jar files in xpi's, althou this is pretty well covered in Goofy's Guide

#3 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 18 February 2006 - 02:33 PM

smile.gif Thanks for this precious and colorful alternate howto .
For your questions :
1. It seems the best place to ask for problems is the "national" forum section but it can be as well in the extension forum without problem I think

2. I personnaly use Mozbackup from time to time but it is true it is annoying to do it each time...
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#4 arno.

arno.

    Member

  • Members
  • 29 posts

Posted 16 May 2006 - 09:14 PM

I just found an alternative way to do :

- download the extension
- install it
- close firefox
- download the locale
- unzip tar.gz file
- find your profile folder. inside it, find a folder named extensions. Inside it, find the folder corresponding to the extension you're translating. Inside it, find chrome.manifest
- open it with a text editor, and add one line of locale. But instead of putting for example :
locale clines fr jar:chrome/clines.jar!/locale/clines/fr/
put
locale clines fr file:///tmp/translation/clines/fr/
assuming you have put the locale in /tmp/translation/clines/fr/

That way, you'll won't have to unzip or rezip the .xpi file.

PS : may be for windows path of file:///tmp/translation/clines/fr/ is expressed slightly different, I don't known.

#5 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 16 May 2006 - 09:20 PM

biggrin.gif Thanks for this tricky tip, dear arno.
I will test it asap !
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#6 MorZilla

MorZilla

    [es-AR] Coordinator

  • BabelZillian Mods
  • 126 posts

Posted 01 October 2006 - 09:14 PM

I just want to say something: The title of this page is enclosed by "<b>" tags: "<b>How to test...</b>"
Boca means Passion
Boca means Love
Boca means Champion

IPB Image

#7 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 01 October 2006 - 11:05 PM

QUOTE(MorZilla @ Oct 1 2006, 22:14) [snapback]19582[/snapback]

I just want to say something: The title of this page is enclosed by "<b>" tags: "<b>How to test...</b>"


Good catch smile.gif I just changed the tags, do you feel better ? tongue.gif
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#8 kennith

kennith

    Advanced Member

  • Members
  • 78 posts

Posted 15 October 2006 - 08:56 AM

I am also use arno's method, but have some difference and tips

1a Download the extension
1b Download the test locale.gz
2 Install it
3 Close firefox
4 Reopen firefox and let it generate folder
5 Close firefox again
6 Find your profile folder. inside it, find a folder named extensions
7 Inside it, find chrome.manifest
8 Open it with a text editor(I use EmEditor), and add one line of locale.(just copy and replace the language-code, 2 of them)
9 Open (WinRAR) both [extensions].jar and [test locale].gz and drag the locale into [extensions].jar\locale
10 Done
9v2(If there's no jar inside, just extract the locale out the the locale folder of the extensions)

Q1 Where is profile folder?
tips1: C:\Documents and Settings\current username\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.default\

Q2 How to find the installed folder?
tips2: sort the extensions folder with created date, the first one should be last installed one.

tips3: if you always need to translate and test extensions, make a shortcut of extensions to desktop biggrin.gif

Hope this can help some people.



#9 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 15 October 2006 - 09:19 AM

Thanks for this new set of steps and tips smile.gif

GoofyNote : to spot the new-installed extension specific folder, there is a very handy tool, called Extension Manager Extended, that has this feature : open the target extension folder on a click. Can be used to drag and drop the locale to be tested in the desired folder. wink.gif




Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#10 Krcko

Krcko

    [hr-HR] Coordinator

  • BabelZillian Mods
  • 267 posts

Posted 15 October 2006 - 07:40 PM

QUOTE(Goofy @ Oct 15 2006, 10:19) [snapback]20281[/snapback]

GoofyNote : to spot the new-installed extension specific folder, there is a very handy tool, called Extension Manager Extended, that has this feature : open the target extension folder on a click.


MR Tech Local Install also has similar feature wink.gif



Proud to be BabelZillan!

#11 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 15 October 2006 - 08:31 PM

smile.gif Ah yes it is true, but personally, I don't like this extension's concept of "everything in one" (full of other features that are quite useless for me). Just my 2 eurocents.
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#12 fantasou

fantasou

    Member

  • Members
  • 10 posts

Posted 01 March 2008 - 01:39 PM

hi...im new...

i fully translated in Greek the Birthday Reminder Extension but I cant test

i do everything but i cant rezip them to xpi...

help plz any1?

#13 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 01 March 2008 - 02:16 PM

QUOTE (fantasou @ Mar 1 2008, 13:39) <{POST_SNAPBACK}>
hi...im new...

i fully translated in Greek the Birthday Reminder Extension but I cant test

i do everything but i cant rezip them to xpi...

help plz any1?

welcomeani.gif To rezip you need a software. I personnaly use 7zip which is quite useful.
One you have inserted your el-GR locale inside the locale folder, and added the proper line in the chrome.manifest, you must gather all the files in one .xpi file again then test.

[EDIT] I have updated the howto here
http://www.babelzilla.org/content/view/150/25/
with a full image guide and el-GR as an example. Please have a look smile.gif
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#14 fantasou

fantasou

    Member

  • Members
  • 10 posts

Posted 01 March 2008 - 06:33 PM

thank you vm

ill try it ASAP

edit:ok..now what do i do?

#15 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8437 posts

Posted 01 March 2008 - 04:43 PM

QUOTE (fantasou @ Mar 1 2008, 18:33) <{POST_SNAPBACK}>
thank you vm

ill try it ASAP

edit:ok..now what do i do?


you have just to give a test to the extension, see if every Greek message is displayed correctly, check if there is any translation to fix, some possible typo...
When everything is OK then push the status on "released" and the dev is automatically warned by mail that your locale is available.
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#16 fantasou

fantasou

    Member

  • Members
  • 10 posts

Posted 01 March 2008 - 05:13 PM

problem!

when i try to install it on thunderbird, i take a "Not correct installation pack" or something like that...any ideas?

#17 lois

lois

    Member

  • Members
  • 23 posts

Posted 23 July 2008 - 04:27 PM

QUOTE (Goofy @ Feb 18 2006, 09:36) <{POST_SNAPBACK}>
There is no possibility to rebuild automatically the xpi with your locale throughout the WTS, up to now. So if you want to test your locale you can do this :

1. Download the extension (link in the WTS or in the forum topic)

2. Download your locale folder (zipped in tar.gz) from your language page (link at the top)

3. Unzip the xpi (7zip is good for you) and add one locale line in the install.rdf and/or chrome.manifest file. You have just to copy-paste the en-US line and modify the letters according to your own langugae

4. Insert your xx-XX locale folder in the "general" locale folder

5. Re-zip everything in proper order

... and now you can test (on a clean new profile, it is safer)

If one of these steps is difficult for you, just ask on a forum topic, someone will help smile.gif


I've translated PDF Download into galician language, I'm testing it but after installation the extension looks like frozen, no icons, no context menu, no tools menu.

HELP!! please.gif


#18 lois

lois

    Member

  • Members
  • 23 posts

Posted 30 July 2008 - 02:55 PM

QUOTE (lois @ Jul 23 2008, 15:27) <{POST_SNAPBACK}>
I've translated PDF Download into galician language, I'm testing it but after installation the extension looks like frozen, no icons, no context menu, no tools menu.

HELP!! please.gif


Well, ready. The problem was in the alphabetical ordering of the chrome.manifest file.

#19 Lakrits

Lakrits

    Daredevil Test Pilot

  • Admin
  • 894 posts

Posted 24 February 2013 - 06:44 PM

(Just an info post …)

Topic updated

The HowTo (first post in this topic) has been updated and slightly revamped.

Other HowTos, provided by kind-hearted users, are well worth reading as well.
However, if you are one of those users, please consider updating the image
links (or the images, if that is easier smile.gif).

/Lakrits
Acting Pseudo-Goofy ;)
"[…] och han talar med bönder på böndernas sätt
men med lärde män på latin." – Erik Axel Karlfeldt

Lakrits
BabelZilla admin
Moderator for the Swedish BabelZilla forum section


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users