Jump to content

Update IPB External Translations


Valtasar

Recommended Posts

File Name: Update IPB External Translations

File Submitter: Valtasar

File Submitted: 09 Dec 2009

File Category: Maintenance

Supported Versions: IP.Board 3.1.x, IP.Board 3.2.x, IP.Board 3.3.x, IP.Board 3.4.x



Description:
---------------
Simple php script to UPDATE any PREVIOUSLY (externally) translated language files from an older IPB version for a newly released IPB version.
Reads all *.php and *.js language files from "translate" folder, replacing any (translated) language bits found from the corresponding file in "translate/old_translation" folder.
Results are finally written to "translate/new_translation" folder (same filename).
New (untranslated) strings are added at the END of each file, so they can be immediately detected when viewing/editing each file!
One can then examine the output files, make any necessary edits/additional tranlations and finally copy ALL files from "translate/old_translation" to "translate" so that they can be re-imported to the database from the ACP.

How to run:
---------------
1) ACP>Look&Feel>Manage Languages : Activate "External Translation" for your new language. An external translation session will start and language files will be placed in "translate" folder under IPB root folder.
2) Place "update_translation.php" file at IPB root folder.
3) Create two new folders: "translate/new_translation" and "translate/old_translation"
4) Place any PREVIOUSLY translated files from a previous IPB version at folder "translate/old_translation".
5) Run php script (from commandline or from web)
6) Examine the (output) files at "translate/new_translation" and translate any untranslated strings (they are at the end of each file).
7) When finished editing, copy the files from "translate/old_translation" to "translate".
8) Re-import the translated files from the ACP using the "External translation" tool.


Note:
------
SPECIAL strings that DO NOT exist in ENGLISH (they NEED to be added ONLY in languages OTHER than english e.g.: 'calendar_display_title', 'blog_display_title', etc in core_public_global.php) are NOT copied from old translations.
You need to add these language bits manually at the end!



here to download this file

Link to comment
Share on other sites

Good question!
If you already have a 2.3 language translation available, the tool could indeed help (in some extend, since many language bits were heavily changed from 2.3 to 3.0).
For each file in "translate", the script tries to find a file with exactly the same name in "tranlate/old_translation".
A first problem is that 2.3 files had a different naming style, so you first need to find these correspondences and rename your 2.3 files (in "tranlate/old_translation") accordingly:
e.g. you should rename "lang_profile.php" (in 2.3) to "core_public_usercp.php", since they "correspond" to a large extend.

The nice thing about the script is that it will use only the langbits with the same key from your old translation, and it will leave the rest untranslated towards the end of the output file.
Still, a "bad translation" could occur if keys are the same, but the values have been changed between 2.3 and 3.0, but I guess these cases should be rare.

I believe and hope, that you could save some time, using this script even this way - in fact I did something very similar to get my first 3.0 translation,
but with a similar hook (because the nice "external translation" feature was not available back then).

I wish you good luck!

Link to comment
Share on other sites


7) When finished editing, copy the files from "translate/old_translation" to "translate".



This should really be:

7) When finished editing, copy the files from "translate/new_translation" to "translate".

Sorry for the above mistake-unfortunately, I cannot edit the post anymore.
Link to comment
Share on other sites


This should really be:



7) When finished editing, copy the files from "translate/new_translation" to "translate".



Sorry for the above mistake-unfortunately, I cannot edit the post anymore.



Have changed that line in your first post for you. :)
Link to comment
Share on other sites

  • 3 weeks later...

Hi (and sorry for the late reply),

You said "you created the folder called translate", so you problably did not follow Step 1 from the instructions above.
Otherwise, the "translate" folder would be automatically created and would contain the cached files from your database to be translated.

More specific instructions for step 1: ACP>Look&Feel>Manage Languages>(Click on the down arrow at your language)>"Translate Externally...".
This should do the job and create the folder with the files. Then do the other things you mentioned and it should work.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...