How to translate and make the language pack of 3.0?

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
msibm
Registered User
Posts: 53
Joined: Thu Apr 08, 2004 8:43 pm

How to translate and make the language pack of 3.0?

Post by msibm »

Thanks.

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: How to translate and make the language pack of 3.0?

Post by code reader »

Problem:
if you begin translating now, when the developers add new language keys to the english language files, remove existing ones, or move keys from one language file to another, it is difficult to keep your translation in sync.

Solution:
i wrote a small php script to be run from the command-line, that maps all the english language files, and then traverse your language directory, and reports missing files, and missing and superflous keys.

Usage:
in linux/unix: save the file in the language directory, change its permissions to executable, and run it from the command line such (example with language=fr for french):
./chack_lang language=fr
in windoze (also works in *nix): save the file to the language directory, and run it so:
php check_lang langauge=fr

here is the script:
[Excessive Code Removed]

Joablen
Posts: 60
Joined: Sun Aug 27, 2006 3:09 am
Contact:

Re: How to translate and make the language pack of 3.0?

Post by Joablen »

code reader wrote: Problem:
if you begin translating now, when the developers add new language keys to the english language files, remove existing ones, or move keys from one language file to another, it is difficult to keep your translation in sync.

Solution:
i wrote a small php script to be run from the command-line, that maps all the english language files, and then traverse your language directory, and reports missing files, and missing and superflous keys.

Usage:
in linux/unix: save the file in the language directory, change its permissions to executable, and run it from the command line such (example with language=fr for french):
./chack_lang language=fr
in windoze (also works in *nix): save the file to the language directory, and run it so:
php check_lang langauge=fr

here is the script:
[Excessive Code Removed]

attach the php file...

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: How to translate and make the language pack of 3.0?

Post by code reader »

sorry, i did attach the php file to my previous message, and apparently, one of the moderators deemed it excessive and removed it with the comment "Excessive code removed".
i am not sure that the problem was the code size (63 lines of php code are not that much), so, apparently "they" don't like the idea of me posting this code here.
i am really sorry about it, i had no intention to cross anyone or to violate any rule.
if/when anyone from the team will indicate that it's "kosher", i will be glad to release it again.

Anon
Registered User
Posts: 120
Joined: Fri Jan 30, 2004 7:55 am

Re: How to translate and make the language pack of 3.0?

Post by Anon »

If you must post long code, then pastebin.ca will hold it

Code: Select all

:D|-<
:D/-<
:D\-<

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: How to translate and make the language pack of 3.0?

Post by code reader »

Anon wrote: If you must post long code, then pastebin.ca will hold it
i wouldn't say i "must" post the code. i just thought it will be a useful tool for someone who wants to start translating, and may have difficulties keeping in sync with changes to the language files.

but i have a question: when would you start calling a script "long"? could you please give a guideline?
the removed script was 63 lines of php code (including the shebang, the opening and closing php tags and 7 empty newlines), 1453 bytes of code.

i can try and make it shorter, but i doubt this is the issue here.
my conclusion was (and i might have been wrong) that it was removed not because it was too long, but because someone objected to a user posting a tool to help non-sanctioned activity.
if i was wrong, and if you'll tell me that, say, 40 lines are ok, i might be able to meet this standard...

again, if i violated any rule or regulation, or even custom or corteous behavior, i was not aware of it. if this is the case, please tell me what did i do wrong, and i'll try my best not to repeat the offense.

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: How to translate and make the language pack of 3.0?

Post by Acyd Burn »

Personally (i did not remove it) i would say a php snippet up to 15-20 lines is ok, anything else should be attached as a zip or text file or posted to pastebin.

Image

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: How to translate and make the language pack of 3.0?

Post by code reader »

ok, here goes.
http://pastebin.com/793965" target="_blank

msibm
Registered User
Posts: 53
Joined: Thu Apr 08, 2004 8:43 pm

Re: How to translate and make the language pack of 3.0?

Post by msibm »

code reader wrote: ok, here goes.
http://pastebin.com/793965" target="_blank

Thank you!
I use virtual hosting. How to run this script?

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: How to translate and make the language pack of 3.0?

Post by code reader »

it was originally designed for command-line, and i would say that's the simplest and more natural way of running it. my first post in this thread has the instructions.
i would suggest to install php, and run it through the command line. this way, you can test your translation without having to ftp all the files to the host for testing.
assuming you use windoze, look at easyphp and xampp for easy ways to install apache+php and mysql on your home machine.

if you choose not to have php installed on your local computer, it might be possible to run it through the web server.
1) save it to the language directory with ".php" suffix, for example as "check_lang.php"
2) run it like this:
{YOUR_SITE_URL}/language/check_lang.php?language={YOUR_2_LETTER_LANGUAGE_MARKER}

also, since it was built for command-line, it uses \n (newlines) instead of <br>.
the easiest way to deal with it is to add, before the first <?php tag, a single line with
<pre>

hope you'll find it useful.

Post Reply