Updating language files for Opera 9
Published: 2006-03-23 09:03:58
The weekly build from this Monday introduces a new, incompatible, numbering scheme for language strings in Opera. This was done due to internal changes in Opera, the numeric identifiers are now automatically assigned based on the identifiers used internally in Opera, rather than sequentially from a common pool of numbers.
This change helps us in such a way that we can work in parallel adding language file in a much cleaner fashion than before, but unfortunately also means that Opera 9 will be incompatible with all previous language files. In a way, this is good, as using an older language file can cause problems, but is also bad as it causes all the unofficial translations to stop working, and puts the people providing these files in a problematic position when they want to update the translation to a newer version.
For this purpose, I have written a script that remaps the language file from the old numbering system to the new one. It is a simple Perl script that reads the old language file and changes all the numbers over to the new one. If you do not, or cannot, use Perl, you should still be able to make use of the remapping table.
Tags: browsers opera translation
Comments
- Date: 2006-03-23 13:03:02
- Name: nafmo
That is a known bug, the routine to check if the language file is too old will reject any file in the latest weekly build. Meanwhile, you can either use opera:config or edit the ini file manually to point to the new file.
- Date: 2006-03-23 15:03:46
- Name: juanan
Thank you very much for the script ;)
- Date: 2006-03-23 22:03:06
- Name: AbilioKID
nafmo, as you may have noticed I have converted the old 8.52 oficial files (34 of them) to the new strings in build 8303. I'd just like to know if you can check one of them looking for possible errors. I compared side by side the old and the new but I may have forgotten some.
- Date: 2006-03-24 09:03:58
- Name: esfahan
What happens to the Opera buttons all over the WWW ?
All people who published them must now distinguish between before and after build 8303 ?
- Date: 2006-03-24 09:03:22
- Name: nafmo
Opera 9 does support remapping the old identifiers for buttons, toolbar and menu configuration files, etc. It's just the language files that need to be updated. The support for old identifiers might go away eventually, though, so at some point you should upgrade your provided buttons, toolbars or menus.
- Date: 2006-03-24 12:03:29
- Name: KozAKi
Peter, your perl script worked very good in this location (Linux)
thank you :)
Note for people that have problem using it :
I converted the Opera-8.5x French .lng file doing :
1) Conversion :
---------------
- DL Peter's perl script
- put the script along with new english.lng & 8.5x French lng files in a directory that has user read & write rights
- Then launched the script :
$ perl remaplanguagefile.pl ouw852_fr.lng
It will stop at each lines existing in the old .lng file but not in new 9.0 english.lng file. Therewhile I edit the old file doing :
$ gvimdiff english.lng ouw852_fr.lng --> erase those lines.
This way, every comment is preserved, on opposite to Abilio_KID (otherwise very good) localized files :)
2) Update resulting ouw852_fr.lng.remap files with new 9.0 content :
--------------------------------------------------------------------
$ gvimdiff english.lng ouw852_fr.lng --> Change version & add new lines using powerfull gvimdiff features
$ mv ouw852_fr.lng ouw90_fr.lng
3) Make Opera 9.0 use the new ouw90_fr.lng :
--------------------------------------------
# mv ouw90_fr.lng /usr/share/opera/locale/
In Opera, type opera:config in the URL box, expand "User Prefs" & @ "Language File", browse to /usr/share/opera/locale/ouw90_fr.lng
Restart Opera.
Now you got everything back to French in your Opera 9.0 :D
Le fichier de langue en français pour Opera 9.0 sera disponible rapidement sur le tutoriel Opera que je tiens à jour ;)
- Date: 2006-03-24 15:03:13
- Name: esfahan
Upgrading ?
If people use different Opera versions you must provide 2 buttons instead of one. That's horrible for all the people who develop toolbars for download by toolbar.ini or direct download by opera:button-link
- Date: 2006-03-24 20:03:30
- Name: jasisz
I have question: why in 8321 is newer numbering?
- Date: 2006-03-24 20:03:49
- Name: unal
Yes, 8321 needs another mapping... When will it come to an end?
And will you provide a new script for recent changes?
- Date: 2006-03-24 21:03:41
- Name: anonymous
Fabian writes:
Would it be possible to make this Perl script operate on-line somewhere, so we can run it in a web-based environment? Upload old file, copy the conversion from a textarea or something?
- Date: 2006-03-24 22:03:47
- Name: nafmo
The numbering hasn't really changed in the latest build, not at least if you count like a computer. The difference is that the value is now treated as a signed 32-bit integer instead of a unsigned 32-bit integer.
- Date: 2006-03-24 23:03:26
- Name: aleksandaraleksandar
can someone tell me how to remap old .lng file in XP environment?
- Date: 2006-03-25 11:03:41
- Name: Mongoose
What happens with 8321 LNG? I'm about the strings with leading '-' symbols. Is it preparing for lng cleanup in next build or it means something else?
- Date: 2006-03-29 19:03:46
- Name: anonymous
unal writes:
Should we change our language file's related lines to "-" value?
- Date: 2006-04-08 16:04:27
- Name: anonymous
Mario writes:
Remapping for me required to remove some lines (most of them about licensing) from the language file (de), then the remapping script ran through, but still opera didn't accept the remapped file.
What I had to do manually is to change the Version.Linux line in the [Info] section from 8.50 to 9.0. Maybe you can add this to your perl script.
- Date: 2006-04-11 10:04:22
- Name: nafmo
Mongoose, anonymous: Please see the followup post for details on the negative numbers.
anonymous: The remapping script only lists strings that are currently available, it will fail if you try to remap a language file with removed strings.
- Date: 2006-04-25 09:04:01
- Name: nadavkav
i've removed some old string and the great perl script worked smoothly. thanks !
kindly,
nadav :-)
- Date: 2006-05-04 17:05:34
- Name: zih3r
:hi:
Can someone please remapp croatian language file
http://www.ziher-net.com/shared_files/Private/croatian.lng
and send me remapped file to info (at) ziher-net.com
I don't have/understand Perl. :insane: Thx!
- Date: 2006-05-05 08:05:22
- Name: nafmo
zih3r: I removed the strings that has been removed since 8.51, and fixed the file encoding (it was UTF-16 but stated ISO 8859-1, I've fixed it to use UTF-8). Download.
- Date: 2006-05-05 11:05:17
- Name: zih3r
Yes, this is it! ;)
Thank you! Now I must add few new lines and this will be wonderful! And collect new Opera users of course, here in Croatia! :D
- Date: 2006-05-18 15:05:54
- Name: Yury_T
How come opera 9b1 (archive opera-9.0-20060411.5-shared-qt.i386-en.tar.bz2) on linux (suse-10.0 and slackware-10.2) refuses to accept (valid) language file remapped in this manner, if langfile is pointed to in UI dialog, telling something like "language file is not for this version of opera", but accepts this same langfile if pointed to via "-language " start parameter?
- Date: 2006-05-22 15:05:54
- Name: nafmo
Yury_T: That shouldn't happen. Could you please file a bug report and send the problematic language file to the e-mail address you are provided after submitting it?
- Date: 2006-06-29 09:06:18
- Name: Yury_T
Done, the bug #217630.
- Date: 2006-06-29 16:06:38
- Name: nafmo
Thank you.
- Date: 2008-07-24 11:07:54
- Name: MarcusHassmann
The script isnn't downloadable because url http://people.opera.com/peter/translation/remapper/ isn't found.
Is there a new download link?
This was originally posted on My Opera at
http://my.opera.com/nafmo/blog/show.dml/189902
Please note that links may be outdated and any information included here
may be obsolete.
← Paying respects | Tweaking the language file format → | Back to the post index | Back to the archive index | Peter's homepage
I've updated the custom language file I use (russian.lng) to use new string IDs. But Opera still complains file is not compatible with Opera version when I try to choose Russian in preferences. Renaming russian.lng to english.lng works fine though - menues are in russian and no complaints displayed.
Is it a regression or intentional behavior? How do I make Opera load non-english.lng file?
(Of cause, I've updated DB.version, Build.Win, Version.Win in there to match those of english.lng)