I am running several mods in EasyMod. These mods are
changing a number of language files. These are text
files for English and Spanish, for example. These files
have the same name (like lang_main.php) but are in
different folders. This problem occurs in different
mods, not just one. I validated the mod.
The first time EM processes a particular file name, it
will also try to process that same file name in the
other folders.
In one run I noticed that EasyMod, while processing a
"Find", was looking for the same line of code in each
of the files, even though the mod file specifies a
different line of code for each file.
Example:
FIND FAILED: In file
[language/lang_castellano/lang_main.php] could not find:
$lang['Click_view_privmsg'] = 'Click %sHere%s to visit
your Inbox';
FIND FAILED: In file
[language/lang_asturianu/lang_main.php] could not find:
$lang['Click_view_privmsg'] = 'Click %sHere%s to visit
your Inbox';
Of course, that fails because these files aren't in
English.
The order of the error messages also suggests that the
file was looking for this line in each directory's lang
file before moving on to the next set of instructions.
The problem occurs only on the first encounter with the
file name. EasyMod processes the file in the
lang_english folder, then checks the other two in
alphabetical order (not the order they are listing in
the mod). This may not the actual procedural order, but
it is how the errors and results are presented for display.
This is the listing from the "Making Backups" window in
Step 3 (with my notes in caps)
Code:
privmsg.php completed
includes/bbcode.php completed
THIS ONE WAS SUPPOSED TO OCCUR:
language/lang_english/lang_main.php completed
THE NEXT TWO WERE NOT SUPPOSED TO OCCUR AND FAILED,
CAUSING NO DAMAGE:
language/lang_asturianu/lang_main.php completed
language/lang_castellano/lang_main.php completed
THIS ONE WAS SUPPOSED TO OCCUR:
language/lang_english/email/privmsg_notify.tpl completed
THE NEXT TWO WERE NOT SUPPOSED TO OCCUR AND FAILED,
CAUSING NO DAMAGE:
language/lang_asturianu/email/privmsg_notify.tpl
completed
language/lang_castellano/email/privmsg_notify.tpl
completed
THE NEXT FOUR WERE SUPPOSED TO OCCUR:
language/lang_castellano/lang_main.php completed
language/lang_castellano/email/privmsg_notify.tpl
completed
language/lang_asturianu/lang_main.php completed
language/lang_asturianu/email/privmsg_notify.tpl
completed
Please let me know if you need more info. I'll upload a
copy of the mod.
mod which processes three lang_main.php files that causes the extra processing
Logged In: YES
user_id=779036
I'm not positive on what you're saying. EasyMOD is designed
to take a FIND in the lang_english folder and propagate the
changes across all installed languages. This is to ensure
that if the language variable isn't in the chosen language,
at least it's in _some_ language. However, this can only
work if the line to FIND only contains the language
variable, not the translation of it. If your MOD has
separate instructions for each language, they really should
not be in the main install file. They should be installed
separately.
Let me know if I understood correctly and/or if you did.
P.S. I just saw the attached file and it appears that your
MOD is the latter case that I mentioned. The MOD should be
rewritten so that the finds for the language variables
contain only the variables themselves, not the translations,
and the non-English translations should be in separate
installation files (solely for the language variable changes).
Logged In: YES
user_id=1333174
Thanks for your quick response, GPH. That's interesting.
It'd be nice if EM had an option (a check box toggle) for
processing the language files separately (in other words,
not adding the English to the non-English files). That would
also help clarify the default behavior.
Logged In: YES
user_id=1333174
I've found a better way to handle translations. It appears
to be a built-in feature of EasyMod.
Kooky has written a good example here:
http://www.myphpbb.zaup.org/viewtopic.php?t=6
That's his Email Confirmation v1.0.1 mod.
He doesn't mention the translations in the main mod. The
translations are placed in a folder called "translations".
The translation files are given the same name as the file
you want to update, except with .txt added: lang_asturianu
becomes language_asturianu.txt
The translation is a typical mod. I'm not sure if it has to
parallel the main mod.
It works without any errors.