07: Watch your Languages

This is a temporary forum setup for the purpose of discussing the EMC standards
Locked
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

07: Watch your Languages

Post by Nuttzy99 » Thu Sep 18, 2003 1:38 pm

Watch your Languages!

phpBB has support for over 40 languages. The MODing community supports the use of the phpBB multilingual system. Many MODs have been translated into several languages but until now there has not been any standization of how multilingual support for MODs should work.

The least you need to know:
  • restrict FINDs to only the $lang[] key
  • do not use comments as FIND targets in a lang_ file
  • translations for lang_main type files are stored as a seperate lang_xxxxxx.txt MOD-style file
  • translations for MOD specific lang files are stored in the same directory as lang_filename_xxxxx.php
[/b]
FIND and lang_ files
For our purposes, there are two kinds of lang_ files. First we have the files including lang_main and lang_admin that have $lang keys defined. We also have the FAQ files that include lang_bbcode and lang_faq. You must keep in mind that ALL languages are going to be updated as best we can do so a convention must be adopted for MODing both kind of files. This discussion is also covered in the FIND section of this document.

The lang_main and lang_admin files are the most commonly MODed files. Fortunately they are also the easiest to deal with. No matter what language we are using, the keys in the $lang[] array always remain the same. Between the numerous translations, the values may change and the code comments may change, but the keys will always remain the same. Therefore when performing a FIND to add more $lang[] entries in the file, you must restrict the FIND to include only the $lang[] key and not the value. For example, instead of this...

Code: Select all

#
#-----[ FIND ]----------------------------------
#
$lang['Forum'] = 'Forum';
...you should restrict your FIND to this...

Code: Select all

$lang['Forum']
...and it will work 100% of the time for all languages. Also, since comments in the lang_ files change from translation to translation, and even from version to version, you should never use them. For example this...

Code: Select all

// That's all folks!
...appears like this in the official Spanish translation...

Code: Select all

// Eso es todo amigos!!!!
...so it cannot be relied on.

The FAQ lang_ files are more tricky and fortunately used much less. These files do not have any $lang[] keys that we can rely on for positioning. Therefore the searching in this files in all but the native language is impossible. The only solution is to MOD these files as you normally would and EasyMOD will update files from other language by placing any lines to be added to the file just before the closing ?>


About Translations
It is intended that MODs will be written for one primary language. In the case of http://www.phpBB.com" target="_blank that means English. Many MODs, especially the most popular, have been translated into many different languages so they may be used by the international phpBB audience. But when it comes to development, it is just not possible to have all the translations ready before releasing the MOD. Also, the translations may need to be updated for various reasons, such as typos, independently of the MOD. We need to allow translators the maximum flexiblity in providing translations as frequently as they need to and whenever they need to. Therefore the best solution is to store all non-English langauage data outside of the MOD script, in seperate files.


Translations for lang_ Files
Some MODs need to add some additional lines to files like lang_main.php. These lines are simply added through the MOD script. The process is very straight forward, requiring no explanation... until you consider translations. But don't worry this is pretty simple as well ;) The translated text will be it's own little MOD stored in a seperate file.

Let's start with by explaining the name of the file. For our example, let's say we want to provide a Spanish translation. The filename will be lang_spanish.txt. Notice that "spanish" is lowercase. The name needs to match the directory name in /languages/lang_xxxx where xxxx is the name of the language as assigned by phpBB. As for location of this type of file, to provide maximum flexiblity for Authors, you may locate this file anywhere in this MOD's directory. It is recommened that you keep all language files for this MOD in the same directory, such as /translations or /languages.

As for the content of the file, this is very straight forward. Say the original MOD script contains the following...

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_main.php


# 
#-----[ FIND ]------------------------------------------ 
#
# NOTE: the complete line to find is:
#  $lang['A_critical_error'] = 'A Critical Error Occurred';
# 
$lang['A_critical_error']


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// FLAGHACK-start
$lang['Country_Flag'] = 'Country Flag';
$lang['Select_Country'] = 'SELECT COUNTRY' ;
// FLAGHACK-end

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM
...then the French translation would consist of file named lang_french.txt with this following content (pardon my French :P )...

Code: Select all

# 
#-----[ OUVRIR ]------------------------------------------ 
# 
language/lang_french/lang_main.php


# 
#-----[ TROUVER ]------------------------------------------ 
#
# NOTE:  la ligne complète à trouver est:
#  $lang['A_critical_error'] = 'Une Erreur Critique est Survenue';
# 
$lang['A_critical_error']


# 
#-----[ APRES, AJOUTER ]------------------------------------------ 
# 

// FLAGHACK-start
$lang['Country_Flag'] = 'drapeau de pays';
$lang['Select_Country'] = 'choisissez le pays' ;
// FLAGHACK-end

# 
#-----[ SAUVEGARDER/FERMER TOUS LES FICHIERS ]---------------- 
# 
#FdM
...if lang_admin.php or any other other lang_ files need translated lines inserted, they would also appear in this file. Also note that commands (ie. OPEN and FIND) are in French. The commands need to be written in either the primary designated language (English) or in the language of the translation. Providing the commands in the translated language is the perferred method. This is all apart of the globalization of the phpBB MODing community where we hope that MODs developed anywhere in the world can be used anywhere else in the world!

Providing a header at the start of your file is also a good idea. It is especially important to note what versions of the MOD the translation is compliant with. Noting the revision date of the translation is also effective in determining the latest version. A sample header looks like this...

Code: Select all

############################################################## 
## MOD Title:    Country Flags
## MOD Versions: 1.0.0 to 1.2.0
## Translation:  French
## Rev Date:     September 15, 2003
##
## Translator:  Nuttzy99 < nospam@blizzhackers.com > (n/a) http://www.blizzhackers.com" target="_blank
##
##############################################################
You must not use a line for Author: in the header or EM may think this translation is a MOD.


MODs with thier own lang files
Often times it is easier for larger MODs such as Attach MOD or EasyMOD to create their own lang_ files instead of adding to lang_main or lang_admin. The MOD script will move these files into the appropraite language directory through the use of the COPY command. Under the old convention, this file would also be copied to all other languages directories as well. So for example, assume you have a lang_easymod.php file written in English and you have both English and Spanish lang packs installed. The file would also get copied to /language/lang_spanish even though it is written in English.

The new convention will detect if a lang_easymod.php file translated for Spanish exists and will copy this file to language/lang_spanish instead. All you need to do is add _spanish to the file name (before the suffix) and have the file in the same directory as the English file (or whatever the default language). So if a lang_easymod_spanish.php file exists in the same directory as lang_easymod.php then the file will be copied correctly. The _spanish will be stripped off while moving to the new location.

Translated files that are not needed will be ignored. Therefore if a lang_easymod_french.php also exists in the directory but the French lang pack is not installed, then the file is ignored. If French is installed, but a lang_easymod_french.php file is not present in the same directory as lang_easymod.php, then lang_easymod.php will by default be copied to /langauge/lang_french. It is better to have something present, even in the wrong language, rather than nothing ;)
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site

Bananeweizen
Registered User
Posts: 9
Joined: Tue Sep 25, 2001 9:42 pm

Re: 07: Watch your Languages

Post by Bananeweizen » Thu Sep 18, 2003 3:28 pm

Nuttzy99 wrote:Also note that commands (ie. OPEN and FIND) are in French. The commands need to be written in either the primary designated language (English) or in the language of the translation. Providing the commands in the translated language is the perferred method.
AAaaaaarrgg. That will not work very well for humans because it requires the board admin (or the modder) to understand that foreign language.
Example: I want to install the French translations for all the MODs on my board as there may be French visitors. I don't understand any piece of French language. How shall I install the French translation add-on? This will lead to people translating the action commands of (already) translated language add-ons.

And don't say this is totally out of scope. The installed languages are for the board visitors, they don't need to be understood by the admin himself.

Another question of mine is how shall this be handled by EasyMod? It would require EasyMod to know all actions in all available pphpbb languages. And it would also require that EasyMod can handle all the MOD description tags (author, title, description, ...) of the template in all available languages.

To my mind a much better approach would be to have all MODs written entirely in English (especially the actions and the template header) and to optionally have the actions _displayed_ translated in EasyMod. Translating the installation files themselfes completely will lead to confusion anywhere. Just imagine that a MOD of you is available on the net in the last three versions, each of them translated to 5 different languages by other people. And as all the translation add-ons are done in their native language there will also be people (for instance a German) who translate the French language add-on to a French language add-on with German actions as some other people don't understand French at all. The number of language files is just exploding with "cross translated" files and people will always have difficulties to understand the content of the files.

Ciao, Michael.

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 07: Watch your Languages

Post by -=ET=- » Thu Sep 18, 2003 3:53 pm

Good! :D

You know what Nuttzy: I'm quite happy with your 8 first EMC rules chapter. It's nearly all I always think it was logical, all I've already advised to do on my (dead) French EM support topic and all I've choose to do for my personal MODs. Coooooooooooool!

Of course, nearly nothing of what you wrote comes from me, but I'm just happy to see that I've quite well understand some month ago your philosophy, and then your new EMC rules :wink:

I'm happy too you've like the last fully rewrite MOD template French translation...
Nuttzy99 wrote:The phpBB French site ( http://www.phpbb-fr.com" target="_blank ) appears to be an excellent model. The site is the known hub for the French MODing community and this makes them the logical choice for choosing the wording for any translations. They have already translated the MOD Template commands and it is assumed that this is a widely used resource by the French community.
(have a look at the end of it ;-) )


But now I have 3 remarks: ;)

#1 A main language ok, but not necessarily English?

You were not really clear here.
Previously on phpBB.com you've said that in you opinion, MODs should have to be written for a main language, but this main language should not necessarily be English (as many MODs are made by people who don't speak English and as an English translation can be add afterwards).
We all know that phpBB.com ask to use English as the main language to be able to submit a MOD to their DB, but you previously seems to say that it will not be an EM requirement.

So what is now clearly the rule to be EMC?

#2 File copy in the MOD (not in the translations instructions)?

You confirm that the instructions to copy new language files must be put in the MOD only once for the main language and not in the language instruction files?

#3 What about localized style image?

Just a little preamble about this question: I've tried to contact you many times by MP and email to be able to copy and paste here in a new the mains posts of our discussion on phpBB.com, but I never receive any answer :(
You didn't want, you do not read the MP that are send to you or you forget?
I'm sorry to say that here, but I really don't know how to ask you any (rare) little question anywhere else than here, on a public forum :(
I have 2/3 other important things to say to you, so if you can tell me how to do...
Thanks.

So, about what about localized style image?
There were many possible options to normalize translation and non subSilver style support. Apparently you choose to identify those file by a part of their name ("_xxxxxxx"), but now, what about localized style image like new buttons text on them?

How will we identify them, and will you test that the language and the style are really installed?

That was one reason why I had suggested the phpBB directory structure option to identify the files (but I'm not against any other option, my question is just to know how will we do now?).


That's all :)

But once again you make me more and more impatient for the new release!!!!!!!! lol ;)
It really sounds good, that's nice.
Thanks for this good work Nuttzy :-)
Eternal newbie

Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 07: Watch your Languages

Post by Nuttzy99 » Thu Sep 18, 2003 4:04 pm

Sorry I don't have time to read these replies, but I did read this first sentence...
Bananeweizen wrote:That will not work very well for humans because it requires the board admin (or the modder) to understand that foreign language.
Not the case. A simple program can be written to convert the template commands from one language to another. I just think it would be ridiculous to have translations of translations. I don't want a case where you have...

english to french
english to spanish
english to danish
danish to english
danish to spanish
danish to french
french to english
french to spanish
french to danish

...it is much easier to just have 4 files: English, French, Spanish, and Danish. And then a converter program can fix the commands if necessary.

But I have not read either of the 2 above posts and I will be sure to keep an open mind when I read them. On this topic I am certainly open to other ideas if they are clearly better.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 07: Watch your Languages

Post by -=ET=- » Thu Sep 18, 2003 4:11 pm

Bananeweizen wrote:AAaaaaarrgg. That will not work very well for humans because it requires the board admin (or the modder) to understand that foreign language.
Sure but:
#1 He said it's not an obligation
#2 We need to wait for it's confirmation but he's already said too that English will not necessarily be the main language of the MODs. EMC MODs will be able to be written in Italian, with later, an English translation available.
#3 Not every one understand and is fluent in English. I know French good modders who never and will never write a MOD in English.

But, I agree on the fact that having 20 different languages to install 1 MOD in 20 languages will not be easy for the admin.
I think we may choose our language to create a MOD but I'm not sure that it's a good thing to recommend to write the language instructions in their language.
The choice is nice as a language instruction can be add by anyone who don't speak your language, but the recommendation is "perhaps" too much as it "force" a bit to multiply the languages in the instructions.
Just my opinion :roll:
Bananeweizen wrote:Another question of mine is how shall this be handled by EasyMod? It would require EasyMod to know all actions in all available pphpbb languages. And it would also require that EasyMod can handle all the MOD description tags (author, title, description, ...) of the template in all available languages.
http://area51.phpbb.com/phpBB22/viewtop ... &&start=10
Eternal newbie

Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: 07: Watch your Languages

Post by Nuttzy99 » Thu Sep 18, 2003 9:00 pm

Bananeweizen wrote:To my mind a much better approach would be to have all MODs written entirely in English
Not everyone reads English.
It would require EasyMod to know all actions in all available pphpbb languages. And it would also require that EasyMod can handle all the MOD description tags (author, title, description, ...) of the template in all available languages.
And EM will. All of these will be stored in corresponding lang_easymod file for that language. So if you have the lang_easymod file for this language then EM will have no problem installing these translations even though you can't read them ;)
The number of language files is just exploding with "cross translated" files and people will always have difficulties to understand the content of the files.
Your method would actually force the explosion. Since not everyone can read English you are more likely to need translations of translations. Whereas EM will be able to read these languages without problem.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site

Bananeweizen
Registered User
Posts: 9
Joined: Tue Sep 25, 2001 9:42 pm

Re: 07: Watch your Languages

Post by Bananeweizen » Thu Sep 18, 2003 9:37 pm

Nuttzy99 wrote:A simple program can be written to convert the template commands from one language to another.
All of these will be stored in corresponding lang_easymod file for that language. So if you have the lang_easymod file for this language then EM will have no problem installing these translations even though you can't read them
No, this will not work because of the people. Already now most MOD installation files do use other action names than the 12 defined so far (Out of the about 70 MODs installed on my board about 30 use standardized action names while the other 40 use any action you can imagine). If people are able to write the commands in their own language they will use even more variations of each command. Trust me, people do not want to lookup standardized actions and are very creative in creating new actions (e.g. I myself would change 5 of the German action name translations posted on the first page of this thread to better suited ones...)
...it is much easier to just have 4 files: English, French, Spanish, and Danish. And then a converter program can fix the commands if necessary.
Yep. But as said above it will not work if the file format (i.e. the mod template) is not the same. Your converter would require to understand hundreds of creatively named actions in each language in the end...

I agree that fully translated MODs would make the MOD development easier for some MOD authors. But all such simplification (as the action translation is) should only be a task of the editor application, not of the underlying file format. That's as if you would also change the option names, ini file format, registry key names and other things on localizing (i.e. translating) a standard application.
BTW: I'm currently working on a MOD editor that is an ACP itself. That editor can optionally show the actions translated. But the generated MOD text files are in English only as this is not even relevant for a MOD author using my editor.
Your method would actually force the explosion. Since not everyone can read English you are more likely to need translations of translations.
That's only true if I only install translations in my own language. If people install languages other than their own the probability of understanding that translation file is higher with English actions as English is understood by more people in the world than any other language is.

Until now I always thought that all the ideas around and built into EasyMod will make the MOD development easier for all of us. But this single point (translations of actions and of the MOD template) is to my mind a step backward instead of forward. Sorry.

Ciao, Michael.

User avatar
-=ET=-
Registered User
Posts: 211
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: 07: Watch your Languages

Post by -=ET=- » Fri Sep 19, 2003 12:10 am

Bananeweizen wrote:the about 70 MODs installed on my boarb
8O!
You're MOD adicted? :wink:
Bananeweizen wrote:If people are able to write the commands in their own language they will use even more variations of each command.
That should not be a problem.
Once again, read this topic and especialy this post...
http://area51.phpbb.com/phpBB22/viewtop ... 9224#79224

Nuttzy> Except that your last answer was not clear enough I think (IMO)...
Nuttzy99 wrote:And EM will. All of these will be stored in corresponding lang_easymod file for that language. So if you have the lang_easymod file for this language then EM will have no problem installing these translations even though you can't read them ;)
May you (re)explain clearly here (as it's the right topic or one of the good one I think) how non English MOD instructions (and even non official/exotic ones) will be supported by EM?
Thanks by advance :)
Bananeweizen wrote:as English is understood by more people in the world than any other language is.
That's wrong!

English is the 2nd language in the world before Chinese which with the only Mandarin is spoken by 2 time more persons than English (nearly 1 billion against less than 500 millions for English, on more than 6 billions persons on earth).
English is only spoken by less than 8.5% of the world population :?
Eternal newbie

User avatar
LLKwerv
Registered User
Posts: 81
Joined: Mon May 26, 2003 5:27 pm
Location: Wherever I am.
Contact:

Re: 07: Watch your Languages

Post by LLKwerv » Fri Sep 19, 2003 12:23 am

Actually, I believe that although Chinese is the most common first language, english is more common with first and second language combined. Or maybe I'm backwards.

Will there need to be a new version of EM to handle these?
hello

User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: 07: Watch your Languages

Post by GPHemsley » Fri Sep 19, 2003 12:24 am

LLKwerv wrote:Actually, I believe that although Chinese is the most common first language, english is more common with first and second language combined. Or maybe I'm backwards.
Yes, that statistic about English was wrong. Chinese is above it in something. :?
LLKwerv wrote:Will there need to be a new version of EM to handle these?
Of course. :P

Locked