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:

Re: 07: Watch your Languages

Post by Nuttzy99 » Wed Oct 22, 2003 4:58 am

-=ET=- wrote:#1 A main language ok, but not necessarily English?
The main language will be set by the user. It does not have to be English. EM will be flexible enough to use whatever is choosen.
-=ET=- wrote:#2 File copy in the MOD (not in the translations instructions)?
The COPY command will move the lang files to ALL appropriate locations. More about these paths issues will be covered in the Styles discussion.
-=ET=- wrote:#3 What about localized style image?
Once it is proven that the core implementation of dealing with languages is working well, then I can move on to lesser issues like this. During the beta, it is still possible that I may need to revamp things quite a bit and I don't want to add too much complexity until the core is 100% solid.
-=ET=- wrote:I've tried to contact you many times by MP and email
Sorry but I really only to be able to communicate with anyone through the board. My spare time is too precious and I hate to get sidetracked by others.

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

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

Re: 07: Watch your Languages

Post by -=ET=- » Wed Oct 22, 2003 1:24 pm

Nice to see you back (even if it's normal to take breaks sometimes ;-) )
Nuttzy99 wrote:EM will know these commands for each language b/c (after consulting with any known international sites) the wording for them will be stored in the corresponding lang_easymod.php translation.
So you will have only 1 official commands set per language?
How will phpBBhacks groupies will do with their exotics templates in English?

You previously said that EM will be able to understand exotic templates so it imposes not to fix commands in lang_easymod.php files for any language?
http://area51.phpbb.com/phpBB22/viewtop ... 9224#79224

In fact, to be able to read international or exotic mod templates you will need to add variables for commands wording correspondence such as:

Code: Select all

$lang['EM_mod_template_MOD_AUTHOR'] = 'MOD auteur';
...
$lang['EM_mod_template_COPY'] = 'COPIER';
...
$lang['EM_mod_template_IN-LINE_FIND'] = 'DANS LA LIGNE TROUVER';
But if you put these variables in the EM lang_easymod.php you will have one 1 version for English or French or any other localized mod templates.
So I thought I had understand somewhere that you wanted to put this kind of correspondance variables in a file in the MOD archive to let each author chose...

Code: Select all

$lang['EM_mod_template_COPY'] = 'UPLOAD';
...instead of...

Code: Select all

$lang['EM_mod_template_COPY'] = 'COPY';
...for a release in English using an exotic template (for example).
Nuttzy99 wrote:The main language will be set by the user. It does not have to be English. EM will be flexible enough to use whatever is choosen.
OK, nice :-)
Nuttzy99 wrote:The COPY command will move the lang files to ALL appropriate locations. More about these paths issues will be covered in the Styles discussion.
That was not my question ;)
You have 2 possible ways to install new language entries: install them by instructions to add them in already existing language files, and/or copy new language entries file in the appropriate directory.

So my question was, ok specific language instructions will be in new files, separate from the core mod how-to, but what about the COPY instruction for translation files?
They go to these new language instructions files too or they stay in the core mod how-to?
Nuttzy99 wrote:Once it is proven that the core implementation of dealing with languages is working well, then I can move on to lesser issues like this. During the beta, it is still possible that I may need to revamp things quite a bit and I don't want to add too much complexity until the core is 100% solid.
OK
As you want :)
Nuttzy99 wrote:Sorry but I really only to be able to communicate with anyone through the board. My spare time is too precious and I hate to get sidetracked by others.
I fully understand you but VERY few things can NOT be put on a public board. I've tried to contact you in private only twice in 6 month, and only for things that I can NOT had put on this board, so... I've always no solution :(
Never mind :roll:
Eternal newbie

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

Re: 07: Watch your Languages

Post by Nuttzy99 » Wed Oct 22, 2003 2:36 pm

-=ET=- wrote:How will phpBBhacks groupies will do with their exotics templates in English?
They can supply their own lang_english translation if they want. But honestly, phpbbhacks is ready to jump on board with EM so except for some minor changes (use of "MOD") there won't be much of a difference. And really, my idea is not to cater to everyone under the sun. If you want you MOD to work with EM, then at some point you are going to need to conform to some standards. My job is to make these standards as flexible as possible, but there is a breaking point here.
So I thought I had understand somewhere that you wanted to put this kind of correspondance variables in a file in the MOD archive to let each author chose...

Code: Select all

$lang['EM_mod_template_COPY'] = 'UPLOAD';
...instead of...

Code: Select all

$lang['EM_mod_template_COPY'] = 'COPY';
...for a release in English using an exotic template (for example).
I have no plans to support such a thing. Outside of being able to use a different lang_easymod file I have no plans to cater to "exotic" MODs. To me these MODs are better termed as "noncompliant".
So my question was, ok specific language instructions will be in new files, separate from the core mod how-to, but what about the COPY instruction for translation files?
Either my answer was the correct answer or I still do not understand your question. If you have a "copy lang_x.php to languages/lang_english/lang_x.php" then this single instance in the main MOD script is going to try its best to do the update for other languages as well. In no file will there be a line that reads "copy lang_x.php to languages/lang_french/lang_x.php" b/c all will be handled from the initial line using the base language.
I fully understand you but VERY few things can NOT be put on a public board. I've tried to contact you in private only twice in 6 month, and only for things that I can NOT had put on this board, so... I've always no solution :(
Never mind :roll:
If you sent me (another) PM then I will try to look at it.

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

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

Re: 07: Watch your Languages

Post by -=ET=- » Wed Oct 22, 2003 11:38 pm

Nuttzy99 wrote:And really, my idea is not to cater to everyone under the sun. If you want you MOD to work with EM, then at some point you are going to need to conform to some standards. My job is to make these standards as flexible as possible, but there is a breaking point here.
Good news!
I fully agree with you :)

My question was just to clarify this point, absolutly not to ask you to support too exotic templates.
Nuttzy99 wrote:Either my answer was the correct answer or I still do not understand your question. If you have a "copy lang_x.php to languages/lang_english/lang_x.php" then this single instance in the main MOD script is going to try its best to do the update for other languages as well. In no file will there be a line that reads "copy lang_x.php to languages/lang_french/lang_x.php" b/c all will be handled from the initial line using the base language.
This time it's clear. The copy instructions will stay in the main MOD how-to. Thanks :)
Eternal newbie

markus_petrux
Registered User
Posts: 376
Joined: Fri Jun 18, 2004 10:58 pm
Location: Girona, Catalunya (Spain)
Contact:

Re: 07: Watch your Languages

Post by markus_petrux » Tue Aug 17, 2004 11:29 pm

I've been trying to write a MOD following these guidelines...
Nuttzy99 wrote:Translations for lang_ Files
...
...
The name needs to match the directory name in /languages/lang_xxxx where xxxx is the name of the language as assigned by phpBB.
...
...
MODs with thier own lang files
...
...
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).
...
...
...but I can't get EM to do it.

So... are those features implemented in EM? If not, which is the current "best practice" to provide alternative language packs with a EMC MOD?

Any hint would be much appreciated.

Thanks

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 » Wed Aug 18, 2004 6:04 am

Nope, those features aren't yet incorporated into EasyMOD. Your best bet would probably be one of two things:
1) Include a separate MOD file for each set of translation instructions. (For example, a text file with just the instructions on how to modify language/lang_spanish/lang_main.php.)
2) Mention in the Author Notes that translations are available and have been included. (In other words, don't use any MOD actions to do the extra modifications, only extra files.)

markus_petrux
Registered User
Posts: 376
Joined: Fri Jun 18, 2004 10:58 pm
Location: Girona, Catalunya (Spain)
Contact:

Re: 07: Watch your Languages

Post by markus_petrux » Wed Aug 18, 2004 10:24 am

Thanks for answering too quickly, GPHemsley. :)

ok, the problem, as I see it now (or maybe I'm wrong), is EM applies any modification targeted to lang_english/lang_whatever.php, also to lang_any_other_language/lang_whatever.php (automatically). Same happens with any lang files provided by the MOD via COPY action.

So, instructions to install additional languages should take into account that. ...and those instructions should applied manually by the user.

Is that correct?

If so, maybe a good idea would be to add an option to EM to ignore additional languages when processing lang stuff. ie. deal with lang modifications as if it was a regular file. At least, until a better thing is coded into EM (say, the good ideas on top of this topic). Otherwise, people with more than a language in their boards have a big problem, I believe.

Thanks again.

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 » Wed Aug 18, 2004 10:58 am

markus_petrux wrote:ok, the problem, as I see it now (or maybe I'm wrong), is EM applies any modification targeted to lang_english/lang_whatever.php, also to lang_any_other_language/lang_whatever.php (automatically). Same happens with any lang files provided by the MOD via COPY action.
That's not exactly a problem. If EasyMOD didn't do that, users using a language pack other than English would get PHP errors of undefined offsets, and it least it gives the non-English speakers something to work with in comparison to it being blank.
markus_petrux wrote:So, instructions to install additional languages should take into account that. ...and those instructions should applied manually by the user.
Now, I'm assuming that including instructions for modifying language packs other than English inside the MOD stops EM from continuing. I haven't tried it, myself. But, what I was referring to earlier was another MOD that would be processed by EM just the same as a regular MOD, except separately. This may not be a practical solution if EM fails when language packs other than English are specified.
markus_petrux wrote:If so, maybe a good idea would be to add an option to EM to ignore additional languages when processing lang stuff. ie. deal with lang modifications as if it was a regular file. At least, until a better thing is coded into EM (say, the good ideas on top of this topic). Otherwise, people with more than a language in their boards have a big problem, I believe.
My guess is that Nuttzy will want to cut straight to the chase and get all these accessibility things out of the way as soon as possible. Plus, I'm not sure what else has to be done that would have higher priority than this. But I'd have to look at a To-Do list to confirm that.

markus_petrux
Registered User
Posts: 376
Joined: Fri Jun 18, 2004 10:58 pm
Location: Girona, Catalunya (Spain)
Contact:

Re: 07: Watch your Languages

Post by markus_petrux » Wed Aug 18, 2004 4:52 pm

Well, the following tries to be as constructive as possible.

And (hopefully) helps to analize "the problem" of using current EM implementation (v0.1.13) to install MODs on boards with more than one language.

I have create a small MOD with the following contents (ZIP attached, see below):

Code: Select all

lang_test_mod/lang_test_english_mod_1.0.0.txt
lang_test_mod/lang_test_spanish_mod_1.0.0.txt
lang_test_mod/lang_test_catalan_mod_1.0.0.txt
lang_test_mod/language/lang_english/lang_test.php
lang_test_mod/language/lang_spanish/lang_test.php
lang_test_mod/language/lang_catalan/lang_test.php
The actions for lang_test_mod/lang_test_english_mod_1.0.0.txt are:

Code: Select all

#
#-----[ COPY ]------------------------------------------
#
copy language/lang_english/lang_test.php to language/lang_english/lang_test.php
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['Good_morning'] = "Good morning!";

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
The actions for lang_test_mod/lang_test_spanish_mod_1.0.0.txt are:

Code: Select all

#
#-----[ COPY ]------------------------------------------
#
copy language/lang_spanish/lang_test.php to language/lang_spanish/lang_test.php
#
#-----[ OPEN ]------------------------------------------
#
language/lang_spanish/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Good_morning']
#
#-----[ REPLACE WITH ]------------------------------------------
#
$lang['Good_morning'] = "¡Buenos días!";

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
The actions for lang_test_mod/lang_test_catalan_mod_1.0.0.txt are:

Code: Select all

#
#-----[ COPY ]------------------------------------------
#
copy language/lang_catalan/lang_test.php to language/lang_catalan/lang_test.php
#
#-----[ OPEN ]------------------------------------------
#
language/lang_catalan/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Good_morning']
#
#-----[ REPLACE WITH ]------------------------------------------
#
$lang['Good_morning'] = "Bon dia!";

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
The contents of language/lang_english/lang_test.php is:

Code: Select all

<?php

$lang['Good_night'] = "Good night!";

?>
The contents of language/lang_spanish/lang_test.php is:

Code: Select all

<?php

$lang['Good_night'] = "¡Buenos días!";

?>
The contents of language/lang_catalan/lang_test.php is:

Code: Select all

<?php

$lang['Good_night'] = "Bona nit!";

?>
ok, let's say my board ONLY has english and spanish installed.

What happens installing the different MODs?
  1. Install lang_test_english_mod_1.0.0.txt

    This is the "normal" step for any MOD. So...
    1. EM copies the file language/lang_english/lang_test.php to language/lang_english AND language/lang_spanish.
    2. EM modifies language/lang_english/lang_main.php AND language/lang_spanish/lang_main.php adding the english entries to both.
    Well, it worked. I have a "correct" version of my english files ...AND a "safe" version of my spanish files.
  2. Install lang_test_spanish_mod_1.0.0.txt

    Note the spanish MOD Script uses REPLACE WITH (instead of BEFORE/AFTER ADD) to replace the "safe" version of lang entries added by the english version of the MOD Script.

    So this approach works as well with EM. The spanish version of the MOD just REPLACES the english entries/files with the spanish versions.

    However, IMHO, this procedure sounds a bit confusing to the end-user. Also, as an additional problem. The backups made by the english version of the MOD are overwritten by the spanish MOD. To avoid this, the MOD author should write a big note to guide the user to run the additional language MODs from separate folders within the admin/mods folder, ...or provide the correct folder structure for the MOD within the ZIP file.

    I'm not sure how other MOD authors deal with this situation. It seems to me, most of them leave "the step" to manual intervention of the user.

    So, that's a problem, IMHO, since I (as an end-user) still need to apply manual changes to my phpBB files. Which is against the consistency of all backups made by EasyMOD for previously installed MODs. That, for sure will lead to problems for the future Uninstall MOD feature.
  3. Install lang_test_catalan_mod_1.0.0.txt

    Finally, this one. We have not installed the catalan language, remember? Though, let's say we (by error, we're human, you know) install this MOD with EM. This is what EM will tell us:
    Critical Error

    Function Trace: open_files[5]->modio_open[1]

    Could not open [language/lang_catalan/lang_main.php] for reading.
    MOD script line #36 :: FAQ :: Report
    But wait, the phpbb-root/language/lang_catalan folder has been created! ---> EM Bug?
I hope that helps everyone.

Cheers
You do not have the required permissions to view the files attached to this post.

hayk
Registered User
Posts: 10
Joined: Thu Jun 19, 2003 3:30 pm

Re: 07: Watch your Languages

Post by hayk » Tue Mar 08, 2005 1:28 am

Nuttzy99 wrote:
Translations for lang_ Files

...
When this feature will be implemented ?
Հայկ

Locked