Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multilanguage support
#1
Another long-term thing which might be useful but is very hard to implement the way CMS would be still simple. The simplest implementation coming to my mind would be this:
Implement in setting page (or anywhere else) ability to add languages while one being selected as default.

On front end there would be URLs like

{$root}/some-page/

On other languages
{$root}/language/some-page/

When creating page there would be selectbox/tab/anyotherwaytoswitch between languages. This way you could keep very easily one page for every language because now the only way to do multilanguage is to create folder with language and this way you have to create structure for every language (not to mention templates to make sure right things will be included in menu). I imagine they would be stored the same way articles are stored now with only one difference. There would be a file.xml and files like file-language.xml

There would also have to be a way to have multiple menus for everylanguage considering that some language might have a file included in menu, some might not, not to mention different SEO urls.
Reply
#2
we need better lang support, I'm willing to translate it to my local
Reply
#3
you are talkin about a little bit different lang support but yes i agree it might be nice Smile i'd be willing to translate it to 2 different languages
Reply
#4
If you take a look at opengoo.org which is a opensource project, you can find very easy translating system, I recommend you to contact them and ask them which source they are using.
Reply
#5
Giving the admin panel mulitlanguage support will probably be #1 on the new feature list - Right now it is limiting who can use GetSimple -- Big problem. I just need to find out how to do it best now....
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#6
Have you checked the opengoo translator?
Here are some demo pics:

[img=Translator]http://spilun.is/opengoo.png[/img]
Reply
#7
wow - that is cool.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#8
Yeah, that is and more cooler is that you can find missing translations and something like that.

Should I contact the team and ask for the code? I have been posting aloat on their forum, so I think that they will be open minded to give me the code
Reply
#9
If you think it would help us, then sure. So is this a separate app that would create the lang file?

I'm having trouble figuring out how to make it work on the pages though. i think Wordpress uses something like an __e('Text to be converted'); function... i just have no idea how it works though.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#10
They make a function. I think the best idea is to include some file eg. /lang/yourlang.php in every file and you could fetch those strings with $lang_homepage or something. I will contact opengoo and ask them about their translator
Reply
#11
ccagle8 Wrote:Giving the admin panel mulitlanguage support will probably be #1 on the new feature list - Right now it is limiting who can use GetSimple -- Big problem. I just need to find out how to do it best now....

yep fully fine by that just wanted you ropinion about this feature. If this CMS is targeted on small bussiness site, sooner or later it will be necessary.

As far as kristjanmik suggestion is considered it can be done very easily (considering it will go to admin only) it will take some time to rewrite all the words in admin to definition words and then create a list of words like this

define("CONSTANT", "Hello world.");
define("CONSTANT2", "World"); // this word might be a little bit confusing so I'm explaining what it does
etc.

This is very simple way to do it (and it is more then enough because there isn't so many phrases in admin panel). Opengoo did it well but it is not necessary (at least not at this stage) to create a file generator.
Reply
#12
That is the fastest way to translate a file, so I'm voting for it.
Soon we will have plenty of translation if we have an easy tool, so everyone can translate
Reply
#13
If you need me for a dutch translation, you know where to find me.
GetSimple! CMS themes: SimpleTheme! | French Avenue | iGetSimple
Reply
#14
Here is the answer from opengoo team:

Opengoo team Wrote:You can download the latest OpenGoo and check file 'application/controllers/ToolController.class.php'. In that file there's a function called 'translate'. That function is the one invoked to build the translation tool. This function just loads all the necessary info and then sends this info to another file that is in charge of printing the web page. This other file is 'application/views/tool/translate.php'. This was done like this because OpenGoo uses the MVC pattern. You could copy all of the code (the function and the view) and put it in one file with some modifications to achive the same behavior. Some things you should consider:

1) The 'translate' function calls other functions in the ToolController which you would have to copy too, and maybe it uses functions defined on other places in OpenGoo. You coulduse a good IDE to be able to find all this functions quickly (like Ctrl+click on the function name to go to the function). One good IDE is Eclipse PDT.

2) This tool was made for OpenGoo's language files format. It would have to be changed if the file format you use for translations is different. OpenGoo's file format is a PHP array (key => value) in the case of PHP files, and a Javascript object (key : value) passed to a function called 'addLangs' in the case of javascript files. You can check these formats in the language folder.

3) The function 'translate' passes all the info to the 'translate.php' view by using function 'tpl_assign'. What this function does is that it creates variables named like the first parameter, containing the value given as the second parameter. These variables are directly accessible in 'translate.php'. If you wanted to join all of the code as I mentioned earlier, instead of doing tpl_assign('name', $value) you could just do $name = $value; to achieve the same effect.

Hope it's not too confusing. If you have any questions you can ask me.

Regards.
Reply
#15
@kristjanmik - sort of going back to the defining constants thing - I know of some applications that have all the different patterns like that stored in XML files - and seeing how this is developed could be a feasable option too. I think the stored constants/XML files would be the best, because we all know how well internet translators work. We would just need people to be able to translate.
------
I can't design for shit but I can code the shit out of your design
Reply
#16
Sure, just to make it simple and accessible
Reply
#17
I feel like it would allow for third parties to translate it easier and simpler. And if we run it through a translator, I know that in some languages, certain phrases use different endings than just word for word translations.
------
I can't design for shit but I can code the shit out of your design
Reply
#18
In case you need help for the german translation - contact me...
Reply
#19
will do wizzy. thanks for the offer.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#20
i am here for slovak & czech lang
Reply
#21
Would gladly make a french translation.
Reply
#22
also .. i would gladly do a romanian translation Smile
Reply
#23
I've been looking into this, and I sort of like the way phpBB does there i18n. It seems easy enough to implement:

Have a language file that has an array with constants with their values.
Code:
$lang = array(
    'ABOUT_USER'            => 'Profile',
    'ACTIVE_IN_FORUM'        => 'Most active forum',
    'ACTIVE_IN_TOPIC'        => 'Most active topic',
    'ADD_FOE'                => 'Add foe',
    'ADD_FRIEND'            => 'Add friend',
    'AFTER'                    => 'After',
...

then in the page itself, you just call that variable like this:

Code:
<p><?php echo $lang['ABOUT_USER'];</p>

what does everyone this of this approach? I've seen a few other apps do it this way as well...
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#24
is it more efficient than doing stuff like:
define("CONSTANT", "Hello world.");
echo CONSTANT;

?
Reply
#25
Would we run into anything that would be "reserved" if we did it that way? That looks fine as well...
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply




Users browsing this thread: 2 Guest(s)