-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html -> php for add gettext multilingue #8
base: master
Are you sure you want to change the base?
Conversation
libredocs is a pure client-side app, so I don't see the point of adding PHP as a backend-requirement just for internationalization :). But you could take a look at the various Javascript I18n libraries out there, e.g. http://code.google.com/p/jquery-i18n-properties/ |
cool stuff!! we need to do this on the client-side, though, because libredocs.org is hosted on 5apps, it's pure html5 and there is no way we do run a hosted 'collaboration server' which acts as a proxy to i'll think about it some more about how we can add translations to libredocs! On Mon, May 21, 2012 at 1:16 AM, Benoît
|
Niklas, Michiel, I'll take the time to study Javascript I18n libraries and trying to better understand all that stuff... Thanks again for your attention |
Feel free to drop in #unhosted channel on freenode if you have any questions. |
For Libre Projects, @jhuet wrote Javascript powered translation using JSON files with simple "English":"New language" syntax. |
Javascript is still a bit obscure to me, I'll studied the code of LibreProjects carefully. |
I've tested the script from "LibreProjects" proposed by @huet. I would need some tracks Thanks |
Ok, lets see.
(function() {
// your code here
})(); That way you can declare all kinds of variables within that function without exposing them to any other code. Reduces the risk of name clashes and is presumably going to bring world peace. However, as we're using jQuery you should use the following variant of the above: (function($) {
// your code here
})(jQuery); that way your code still works, even if jQuery.noConflict() is used. As for points (1) and (2), see nilclass/libredocs@e5d4656 Hope this helps a bit. |
Oh, another point: you should think about using "real" translation keys instead of just using the original English text as such. That brings the following benefits: That way you could also get rid of that whole $element.data('translatable') and .translatable business and instead use |
Thanks for all your inputs, i really appreciate it as i knew i surely didn't use the best way to do client-side translation since the beginning anyway :) There's also variable handling that needs to be taken into consideration for having a complete translation process. Like, if i want to translate : Welcome bencharp, how are you doing ? and have bencharp change depending on the connected person. We started to have a look at that on this issue over at Libre Projects and found 2 javascript libraries that could help : Hopefully it'll help you too ! |
Another option for variable handling would be to use a simple template engine, such as _.template or mustache, which would allow conditionals in translations, which might be useful. |
Here some news. In my dream, I'm looking for a solution easily to graft in any project and where the languages files could be translated with Gettext. |
cool! let us know how it goes. it would be really nice to have Libre On Thu, Jun 7, 2012 at 4:06 PM, Benoît
|
Hello Michiel,
It's not a pull request, it's just for that you could take a look.
For me, it was mainly to experiment and apply gettext in a real project.
I don't know if that can be useful for you.
thanks of your reply
benoit