Translation
Closed this issue · 15 comments
Hello,
This bundle uses subject-verb-complement phrasing, but for non European languages, it's completely different ex:
To say Chuck norris ate a nyan cat
the phrase would look like Chuck norris a nyan cat ate
(in Korean or Japanese)
It's basically Yoda speaking.
So my question is : How would one simply and efficiently make a Timeline file translatable ??
If phrase looks like identiqual structure "subject, verb, complement, indirectComplement" there is no problem i guess.
In Korean or other, we should let "ate" as verb
, and nyan cat
in directComplement, if we can do that, i don't see your problem, we'll be able during rendering on template system to know which language to use and so to sort the fields.
Or may i misunderstood something ?
Hmm, ok
I'm wondering about the different ways to do it. May be like that :
{{ timeline.verb | trans({'%subjet%' : timeline.subjet, '%complement%' : timeline.complement }, 'TimelineBundle') }}
But then I was not sure this way is the best as there would be a plain translation file depending on a variable (verb).
Anyway the verb will be hardcoded in the php...
But at this point and using the previous example I'm wondering how you would make the subject clickable, just like for a facebook news.
I see, it's a problem about translation system, it's difficult to get a simple translation by having only "dynamic" fields.
But i guess it could be useful to have verb rendered on different file by language.
Actually we have:
path/{verb}.html.twig
We could have:
path/{verb}.{culture}.html.twig
It could be an option to pass to timeline_bundle + a language fallback.
WTF ?
You already can make your own rendering BTW, isn't it ?
+1 for the routing modification
Ah I see, yes that would work just fine :)
@azer, yes :)
I have not the time actually, if you want to contribute you can ;)
Or i'll do it later.
Thanks
Just thinking :
these languages have structural roots, so for asian languages it's mostly chinese.
Here it's mostly latin, and may be there are others, I'm not a pro linguist...
So may be instead of using
path/{verb}.{culture}.html.twig
we could use
path/{verb}.{culture.root}.html.twig
And then translate only words
To make less files
May be it's too much...
Hmmm i see, i guess it's very confusing. But it could be an option too ! ;)
Like:
highco_timeline:
....
i18n:
fallback: en
use_root: true # false by default
....
When you mean roots, it's:
fr_FR => fr
fr_CA => fr
etc...
?
The route does not need to change at all indeed.
You can simply achieved this either by :
- Propagate/fulfill the HTTP Accept-Language Header in your calls
- Or fallback to a query param (like culture=en_US for example)
@stephpy when I say structural root I mean that their grammar are almost identical, only the caracters or words may vary.
So that could be used to simplify the process.
But may be it seems really complicated to simplify it that way.
Ex :
Yoda speaking
- Chinese
- Korean
- Japanse
Latin speaking
- French
- English
- German
Yes @Azer- , user has to define that ? i'm not sure it's a good idea, but for sure user will be able to override Renderer and btw set what he want ;)
Yeah and twig's inheritance solved the problem before I asked this question :p it's the same process.
Ok, so we continue discussion on PR, thanks ;)