MyBB Community Forums

Full Version: The translation system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Right, a member on a forum I administrate pointed me to this forum yesterday and suggested a migration. I like what I see so I decided to translate it into Danish seeing as there is no translation listed. I probably won't be translating the admin panel, but the front-end is about 40% complete.

Anyway, I have a few comments regarding the translation system:
  1. It's sometimes a bit difficult knowing what things means. Sometimes there might be strings that are just conjunctions or prepositions. These cannot just always be directly translated and that makes it difficult when you're supposed to translate just that word alone, because it might change meaning depending on the context in which it appears.
  2. There are a lot of duplication going on and that makes it really annoying to translate. You'll get a "wtf I already translated this once" feeling all the time.
  3. Sometimes sentences are split into multiple strings. This is bad seeing as it'll eliminate languages that doesn't have a syntax that resembles that of the English language.
Examples of duplication are:
Quote:Akismet has detected that this is a spam message and will not be processed.<br />If you find this is in [sic] error please contact your forum administrator.
and then a few lines below:
Quote:Akismet has detected that this is a spam message and will not be processed.<br />If you find this is in [sic] error please contact your system administrator.
(note the error in the original strings, by the way)

I'm quite sure both of them are in use seeing as the index of the former is akismet_newthread and the latter is akismet_newpost. Sometimes there may even be strings which are completely identical across different files.

A solution could be to use something like gettext. Gettext is a standard in regards to translation and you would benefit from using it. PHP has already got an extension for this, but there are also pure-PHP implementations such as the one used in Zend_Translate (in Zend Framework).

The benefits I can think of in using gettext in place of your existing system are:
  1. You'll eliminate identical strings. This is due to the nature of how gettext works.
  2. Untranslated items will fall back to the default language, i.e. English is this case.
  3. Industry standard. People will not have to adapt to a proprietary system.
  4. It'll be easier to add new translations as well as maintain the translation to ensure that there are no redundant, unused data.
  5. You can immediately see within the source code what the original string is because that's where it resides.
  6. Once you've got it implemented it's really easy to use. Need a string translated then just do something like _('Translate this!') (i.e. a function named _) and you're done.
There is one drawback with using gettext instead. It'll be slightly more difficult for people who are not familiar with gettext to translate it. This, however, is easily overcome by providing a decent translation documentation.

Implementing this will obviously be a big, and somewhat arduous, task so it's probably something that would have to wait for the next major version should you decide to do this. Nevertheless, I believe you'll benefit from this greatly!

Anyway, although I haven't had much time to examine it, this looks like a really good piece of software. Smile
(2008-10-15, 10:03 AM)Daniel Egeberg Wrote: [ -> ]
  1. It's sometimes a bit difficult knowing what things means. Sometimes there might be strings that are just conjunctions or prepositions. These cannot just always be directly translated and that makes it difficult when you're supposed to translate just that word alone, because it might change meaning depending on the context in which it appears.
  2. There are a lot of duplication going on and that makes it really annoying to translate. You'll get a "wtf I already translated this once" feeling all the time.
  3. Sometimes sentences are split into multiple strings. This is bad seeing as it'll eliminate languages that doesn't have a syntax that resembles that of the English language.
As a former member of the Hebrew translation team I have to second these points Undecided
(2008-10-15, 10:03 AM)Daniel Egeberg Wrote: [ -> ]A solution could be to use something like gettext. Gettext is a standard in regards to translation and you would benefit from using it. PHP has already got an extension for this, but there are also pure-PHP implementations such as the one used in Zend_Translate (in Zend Framework).
There is one drawback with using gettext instead. It'll be slightly more difficult for people who are not familiar with gettext to translate it. This, however, is easily overcome by providing a decent translation documentation.
I've heard a lot about gettext (BTW, the popular WordPress using this), but I've never really used it, so I can't say nothing about gettext but I'm really like the mechanism of MyBB translation system.

So I would try to give my solutions, we have 3 problems: Dodgy
  1. Sometimes the translator can't decide how to translate a word or a phrase if he doesn't know where it's used
  2. Duplication
  3. Different languages have different grammar
And my suggested solutions: Lightbulb
  1. To add a "Where MyBB using this string?" link to each string, that will list all the places that MyBB uses the string (preferably where in the front-end webpage, but if not, at least where in the source code).
  2. Before releasing a new version to the public run a script that will check for identical strings, and merge them. Sometimes it's useful to make some 'common strings'
  3. Whenever possible - merge strings, e.g. when MyBB using some strings one after the other.
    Anyway, because MyBB Team can't ultimately make the strings suitable for every language, as translators we receive a copy of MyBB a short time before it's go public, this is the time to report any translation issue...
Sometimes in a language, different placements will require different translations although they are the same or different text. Tochjo can attest to that Toungue

Quote:Whenever possible - merge strings, e.g. when MyBB using some strings one after the other.
Anyway, because MyBB Team can't ultimately make the strings suitable for every language, as translators we receive a copy of MyBB a short time before it's go public, this is the time to report any translation issue...
Official translators (ones with the badges) are always part of the beta process for a major release (such as 1.4).