Answer the question
In order to leave comments, you need to log in
Is it worth continuing to work on the framework?
Hello.
Since I'm going to be working with a wide, multilingual Rich Internet Application one of these days, I started googling various front-end translation frameworks. Since none of them really impressed me, I decided to file my scooter.
Borrowing the mechanism of Qt Linguist, I decided to implement this business in JavaScript. So far, the functionality is very, very roughly meager (you need a tool for tracking template strings, a normal template engine, high-quality work with the DOM). But now you can do something like:
Train.dictionary("ru");
Train.tr("Great progress, %1").arg(nickname); // "Отлично работаешь, Олег!"
Answer the question
In order to leave comments, you need to log in
And why not, especially with the widespread use of SPA, the value of this library is growing before our eyes.
It's just that javascript isn't particularly interesting. It would be possible to write another tool for those who do not know javascript, for example, for translators. They write (compile) the translation. Toolza mapit and gives something like:
Train.dictionary("ru", {
"roses_are_beautiful_flowers" : "Розы красивые цветы"
});
Train.dictionary("de", {
"roses_are_beautiful_flowers" : "Rosen sind schöne Blumen"
});
if ('lang' == 'eng')
trans = '/trans/english.jstmp';
elseif ('lang' == 'rus')
trans = '/trans/russian.jstmp';
<script type="javascript" href="<? echo trans ?>" />
Apparently, you are not familiar with PL at all, but you are guided by the frontend, so JS (although without looking at the frontend, I would advise python as the first language). If you don’t know at least the basics of js, don’t start learning jQ in any case, nothing good will come of it.
Then you can plunge into something server-side, but by that time you yourself will know what you need, and it’s not a fact that it will be php.
So as not to produce unnecessary questions, here's a tutorial right away - David Flanagan - JavaScript. Detailed guide...
I wouldn't say so. I am also a beginner and just read the first books on html and CSS, took courses on all known resources as well as the author, and I have a lot of questions of a similar nature.) I heard about habr back in 2010 but didn’t bother to register ... It’s good that this the day has come and I'm with you) There are so many interesting things here - I'm shocked, in fact, I decided to learn JS as the first commenter advised, the word Python scares me)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question