Adiós, BabelZilla

The l10n of Pale Moon. Rawr.
KNTRO

Adiós, BabelZilla

Unread post by KNTRO » 2015-12-08, 15:32

From here:
Moonchild wrote:The future localizations of the browser may be done using transifex, although I'm still not entirely happy with the system there either, as it doesn't work very well for Mozilla software. I may end up writing my own localization interface but in that case it will not be web-based.
I don't remember if I've already asked this, but, would it be possible to use offline Poedit / ".po" files as an alternative for not web based localization systems?
Moonchild wrote:I want to thank everyone for their immense support in localizing the Pale Moon browser
Thank YOU, pal. :thumbup:

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35597
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Adiós, BabelZilla

Unread post by Moonchild » 2015-12-08, 16:56

I wouldn't mind offering poedit, but the attempts at converting .properties/.dtd files to .po have been a disaster. Without a reliable, accurate conversion tool both directions, I'm not sure how that's going to work.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Sob__
Lunatic
Lunatic
Posts: 251
Joined: 2014-02-17, 01:12
Location: CZ

Re: Adiós, BabelZilla

Unread post by Sob__ » 2015-12-09, 01:50

I'll share my experiments with you.

dtd2po.php
Takes en-US .dtd and old localized .dtd and creates .po from them.

po2dtd.php
Takes translated .po, combines it with template based on original en-US .dtd and creates updated localized .dtd.

updater.php
Personally I have no problem working with .dtd files directly. But what I miss, is a simple way to find out what was changed in original en-US .dtd. This script attempts to solve that. It takes original (previous version) en-US .dtd and compares it with updated (current version) en-US .dtd. Then it takes old localized .dtd and updates it to reflect changes in en-US .dtd.
For example, for old en-US .dtd:

Code: Select all

<!-- Tab context menu -->
<!ENTITY  reloadTab.label                    "Reload Tab">
<!ENTITY  reloadTab.accesskey                "R">
<!ENTITY  reloadAllTabs.label                "Reload All Tabs">
<!ENTITY  reloadAllTabs.accesskey            "A">
And updated en-US .dtd (added, deleted and changed stuff):

Code: Select all

<!-- Tab context menu -->
<!ENTITY  reloadTab.label "Updated Reload Tab">
<!ENTITY  reloadAllTabs.label "Reload All Tabs">
<!ENTITY  reloadAllTabs.accesskey "A">

<!-- Some new comment -->
<!ENTITY  reloadAllTabs.newstring "Added string">
From old localized .dtd:

Code: Select all

<!-- Tab context menu -->
<!ENTITY reloadTab.label "Obnovit panel">
<!ENTITY reloadTab.accesskey "O">
<!ENTITY reloadAllTabs.label "Obnovit všechny panely">
<!ENTITY reloadAllTabs.accesskey "b">
Creates updated localized .dtd:

Code: Select all

<!-- Tab context menu -->
<!-- PMTRANSLATE: changed: Reload Tab / Obnovit panel => Updated Reload Tab / ??? -->
<!ENTITY reloadTab.label "Updated Reload Tab">
<!ENTITY reloadAllTabs.label "Obnovit všechny panely">
<!ENTITY reloadAllTabs.accesskey "b">

<!-- Some new comment -->
<!-- PMTRANSLATE: added -->
<!ENTITY reloadAllTabs.newstring "Added string">
It uses the exact structure of updated en-US .dtd (order of lines, comments) and clearly marks what needs to be translated. Currently it does not work incrementally, i.e. the previously existing PMTRANSLATE notes in localized file are lost.

Everything is not tested too much. I tried some random .dtd files from PM, tried some editing in Poedit (which I didn't even hear about until today) and so far, it seems to work fine. But there may be some unnoticed flaws for sure.
Attachments
pmtranstools-beta1.7z
(2.94 KiB) Downloaded 52 times

Locked