Advertisement:

Author Topic: Language Support in General-- 1.1.10 vs 2  (Read 7886 times)

Offline djr33

  • Semi-Newbie
  • *
  • Posts: 38
Language Support in General-- 1.1.10 vs 2
« on: November 03, 2009, 11:29:14 PM »
Hi everyone.

I am currently developing a language/linguistics website and it is very important that it be available in a number of languages, in fact as many as possible.
Once the project gets going, it may in turn help contribute languages to SMF in general, considering the interest/international base of the expected members.

I have browsed the information here, and I don't see any centralized area containing information like what languages are being worked on, what the differences in language support are for different versions of the board, and especially how this relates to upgrades.

I am currently using 1.1.10, mostly because I had the idea for this project a while ago and had a copy from then; I realize I can upgrade to v2 now, but in some ways I don't want to (simpler is better, in my mind, for the most part).

I could move to 2, though, if necessary, and better sooner than later as I make changes.


Will language support soon drop out for v1? Will new languages be added for both v2 and v1? From what I can tell the entire setup varies in the structure of the language code, so I don't think there's any way to make this automated-- that means each translator is developing the translations twice.


I plan to modify the forum to properly integrate with my website, and as part of that I am not too certain about being able to "plug and play" upgrade to newer versions in the future, as I will be adding code directly into the software. For example, I intent to expand the login system to not be dependent on the forum itself but rather generalized to the site as a whole. Because of this, doing an automatic update may cause some of this code to break, and I am wary of relying on it, to say the least.


So what is your advice? Will I be able to use 1.1.10 with new/updated language packs? If I did move to v2 (as available now) would the languages update with v2 smoothly (until it gets to v3, anyway)?

If anyone can point me in the direction of this info (if it is posted somewhere) that would be fine as well.


Also, I have developed a method of having a fallback language should the default not be found that seems stronger than the original code. I can post that here if anyone is interested. In short, if there is a language not supported on the forum at all, it will default to the default language on the board, and I am thinking about making this true to specific items so that incomplete translations will not break, just default to English (or even a similar language, in the hierarchy).


Thanks for having the software available. It's nice to work with as a PHP user.

Daniel

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Language Support in General-- 1.1.10 vs 2
« Reply #1 on: November 04, 2009, 08:12:21 AM »
Hi.

We do have an Internationalization team at Simple Machines. The team handles our list of translators, the hidden boards available to translators etc. as well as local moderators.

Simple Machines has an extensive php language editor where the translators can mass import/export entries, update newer versions from older versions and visa versa, see translation statistcs etc.

Our developers handles new entries, outdated entries, old entries etc. via the developement tools they have available.

So to put it short, Simple Machines has professional tools available to handle translations. There are several links to how to join the translation team on this site, such as in the download section as well as in our news board.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,853
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Language Support in General-- 1.1.10 vs 2
« Reply #2 on: November 04, 2009, 08:16:58 AM »
To answer the core of your questions, 1.1 and 2.0 have very similar support for different languages, at some specifics 2.0 has gone further than 1.1 ( adding multi-language registrations etc. ) but for complete translations of 2.0 you may have to wait for some languages, while the more popular languages should be up to date pretty much all the time.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline djr33

  • Semi-Newbie
  • *
  • Posts: 38
Re: Language Support in General-- 1.1.10 vs 2
« Reply #3 on: November 04, 2009, 11:31:23 AM »
Thanks for the information. I have seen that thread, but I am not sure how I would be helpful/qualified to join the team. I would be more than happy to participate in the translation teams, but I don't have any new languages to offer. I have studied about 10 languages (I'm a linguistics major), but all of them are already translated, with the exception of Latin (which seems not particularly helpful and like a huge pain to translate as the vocabulary just doesn't exist and making it sound "native" would be near impossible). Also, as a native speaker of English I doubt I would be that much help with any of the languages I know because only a native speaker will get the right words for things like "profile", "view topic", "go" (on a button), etc. That sort of vocab seems very difficult to predict.
I would, however, like to support the introduction of new languages to help make the site as accessible as possible. For example, some constructed languages like Esperanto and Interlingua would include some users who are not speakers of any other languages offered.

So does that "extensive php editor" mean that you will be able to keep up-to-date versions of all the languages for 1.1.10 as well as v2? Or should I move up now before I get too far into the project that it won't transition smoothly?


Also, are any of these translations available even though they are incomplete? Having just index.lang.php would be helpful to give the users the feeling that their language is supported.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,853
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Language Support in General-- 1.1.10 vs 2
« Reply #4 on: November 04, 2009, 11:34:02 AM »
All the available language packs are on http://download.simplemachines.org/?languages
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Language Support in General-- 1.1.10 vs 2
« Reply #5 on: November 04, 2009, 11:55:19 AM »
We have way more languages in progress, than the packages available on the download site. Working on SMF 1 doesn't make a lot of sense, as the upcomming SMF 2 will take over from SMF 1.
There's not revisions for language packages, as they are not needed. In SMF 1.1.x, there hasn't been added new entries. Also notice that we do not allow custom sites to have official SMF packages available for download, which I kind of read between the lines you are concidering offering. Correct me if I'm wrong.

Offline djr33

  • Semi-Newbie
  • *
  • Posts: 38
Re: Language Support in General-- 1.1.10 vs 2
« Reply #6 on: November 04, 2009, 03:19:58 PM »
Is there any information about those "way more languages in progress", though? I have downloaded all of the language packs available. Is there a reason that WIP languages could not be made available in part as they are completed? For example, I would like to just have index.language.php for any that are done, because then it would be helpful for those users wishing to use that language. I expect all users on my website will have some ability in English, so that will be a reasonable fallback, but I hope to offer as much as possible in as  many languages as possible, while knowing that there will always be some parts left in English because they have not yet been translated.

I do not intend to redistribute the software/language packs/etc. Rather, I intend to expand my site with the help from its international user base, and if this includes users offering to translate the forum then it will be then available in other languages-- which I would have no problem giving to you to offer other users of SMF. My site will need custom language translations as my entire site will be available in as many languages as possible and with this translations will probably be done for the forum to keep up with any languages added to the site.

If you feel that v2 is the better choice, then I will switch the forum over to that now. Thanks.

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Language Support in General-- 1.1.10 vs 2
« Reply #7 on: November 04, 2009, 06:23:09 PM »
The languages that are not for download, are far from translated. Therefore no reason to have them available. The index.template.php file far from covers the translations in each language. You also have to have all the language files available to prevent errors from appearing in your log.

If I have a language team here doing translation and then you bring us files that are translated as well, you might have translated entries that were translated in the mean time by our translators. That would make no sense.
Besides people name things different, and it's important to use the same words and phrases all the way through a translation.
We can also not tell our translators that someone else did a better job, and that their translation will be overwritten.

It's very kind of you to offer all this, but if you know two languages very well and tried to translate from one to another, you will know what I mean. English is not my native language, and I'm sure that it sometimes shows. Translating the other way around, isn't nessescarily easier.

Offline djr33

  • Semi-Newbie
  • *
  • Posts: 38
Re: Language Support in General-- 1.1.10 vs 2
« Reply #8 on: November 05, 2009, 02:04:03 AM »
I understand.

As for just index.template.php, I think that would make some sense. Here's why:
It would not be even close to a complete translation. It would, however, be better than English-only, if for nothing more than making users feel "at home" on an otherwise English-based site.
For the moment there are plenty of languages available, but in the future I'd love to see some "beta" language packs that are mostly working.
As for errors appearing in the log, a quick reworking of that function can prevent it, and the way I rewrote it smoothly falls back on English (or whatever default you want).
[
Code: [Select]
// Load a language file.  Tries the current and default themes as well as the user and global languages.
function loadLanguage($template_name, $lang = '', $fatal = true)
{
global $boarddir, $boardurl, $user_info, $language_dir, $language, $settings, $context, $txt, $db_show_debug;
static $already_loaded = array();

// Default to the user's language.
if ($lang == '')
$lang = $user_info['language'];

// Obviously, the current theme is most important to check.
$themedirs[] = $settings['theme_dir']; //modified for fallback from original explicit form... why not automate...?
// Do we have a base theme to worry about?
if (isset($settings['base_theme_dir']))
{
$themedirs[] = $settings['base_theme_dir'];
}
// Fallback on the default theme if necessary.
$themedirs[] = $settings['default_theme_dir'];

////LETS FALLBACK ONTO OTHER LANGUAGES
$langarray = array($language,$lang); //grab the two lang vars it uses
foreach($themedirs as $themedir) { //go through each of the above options, of course
foreach($langarray as $langarrayitem) { //go through $lang and $language
$fallbacks = getfallbacklangs($langarrayitem); //get the fallbacks
krsort($fallbacks); //flip it so the best one gets checked first
foreach ($fallbacks as $falllanguage) { //go through each fallback language
$attempts[] = array($themedir, $template_name, $falllanguage, $settings['default_theme_url']); //mimic the attempts above...
}
}
}
///END FALLBACK


// Try to include the language file.
foreach ($attempts as $k => $file)
{
if (file_exists($file[0] . '/languages/' . $file[1] . '.' . $file[2] . '.php'))
{
$language_dir = $file[0] . '/languages';
$lang = $file[2];
// Hmmm... do we really still need this?
$language_url = $file[3];
template_include($file[0] . '/languages/' . $file[1] . '.' . $file[2] . '.php');

break;
}
}

// That couldn't be found!  Log the error, but *try* to continue normally.
if (!isset($language_url))
{
if ($fatal)
log_error(sprintf($txt['theme_language_error'], $template_name . '.' . $lang));
return false;
}

if ($db_show_debug === true)
$context['debug']['language_files'][] = $template_name . '.' . $lang . ' (' . basename($language_url) . ')';

// Return the language actually loaded.
return $lang;
}

And here is the code for the function used to find the languages to fall back on:
Code: [Select]
//set fallback language sets:
function getfallbacklangs($language) {
global $defaultlanguage;
///first check if it is the default language and return if so:
if ($language==$defaultlanguage) { return array($language); }
//ok, not default, so let's create fallbacks:
///function sets up fallback onto default language for system
///and to user defined related languages
switch ($language) { //setup a switch to run through settings below
///use cases and REVERSE order:
//EXAMPLE: defaultlang, ..., similarlang2, similarlang1, language
    case 'english_australian':
        $return = array('english_british',$language);
        break;
    case 'portuguese_portugal':
        $return = array('portuguese_brazilian',$language);
        break;
    case 'portuguese_brazilian':
        $return = array('portuguese_portugal',$language);
        break;
    case 'spanish_spain':
        $return = array('spanish_latin',$language);
        break;
    case 'spanish_latin':
        $return = array('spanish_spain',$language);
        break;
case 'chinese_traditional':
        $return = array('chinese_simplified',$language);
        break;
case 'chinese_simplified':
        $return = array('chinese_traditional',$language);
        break;
default:
$return = array($language);
break;
}
return array_merge(array($defaultlanguage),$return);
}


That is just something to think about. I think it would be a nice feature for the board, but that's up to you/the developers. I'm just giving some ideas from my experience.
The code is not necessarily the cleanest, but it gets the idea across, and it is stable.




And, yes, I understand about having two simultaneous translations conflict. That does seem to be a problem.
However, if the languages in progress are no publicly visible (at least a list with percent complete), then that leaves the rest of us blindly hoping for certain languages-- so if a language I want is not available and I know someone who can help to translate it, I think it makes sense to go ahead with that. If you'd like the files after, I'd be happy to share; if not, or if you are already working on it, that just seems a consequence of not sharing which languages are in progress. This list would also help people who do know a language join the teams, rather than thinking they might have to do it all by themselves.

Anyway, just some friendly feedback. On the whole I'm quite happy with the software, just planning ahead a bit and thinking about some possible improvements.

Offline tivamill

  • Newbie
  • *
  • Posts: 1
Re: Language Support in General-- 1.1.10 vs 2
« Reply #9 on: November 05, 2009, 06:28:44 AM »
I think you might use a google application for language translation of your website. But I don't really know how to do it then but just search some guide on the google search.



Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Language Support in General-- 1.1.10 vs 2
« Reply #10 on: November 05, 2009, 08:39:54 AM »
I'm sorry, but your code is not nessescary. If you download a language package from the download section in non english that is not 100% translated (there are quite a few), the untranslated entries will just be in English. So you will have a file with a mix of the native translation and English.
So some of the available language packs are already "beta" if you like.

In SMF 2, installation of language packages is very easy. So if one wants to have the newest language pack all the time, he/she can just once a week or once a month remove the language pack in the admin center, then choose to install it again. It takes two minutes, then you are running the latest files available.
All one has to do is to make sure not to replace the modifications.xxx.php that can contain entries from mods.

We can and will accept files from the outside, but the users providing it will have to be the ones who did the translation. They can just sign up as official translators. They just have to remember, they have to work with the current translators for that specific language.