In norwegian the titles for a lot of the views pages turn out really strange. It seems to be because the config entity (is it a config entity)? called "view" gets translated. This means different things in english. Like "view" in "view source" and "view" in "this is a nice view". Could we get a context for the translation of that?
One example is the "are you sure you want to delete the view content" which gets translated like this (simplified):
t('Are you sure you want to delete the %type %label', array('%type' => t('View'), '%label' => 'Content'))
In norwegian the word "view" gets translated into something like the english word "show" (like in "show source" to continue my example above). So the sentence makes no sense :)
So... here is a patch that gives context to the entity type label of view... coming up.
Comment | File | Size | Author |
---|---|---|---|
#6 | entity_type_view_should-2468565-6.patch | 935 bytes | eiriksm |
#1 | 2468565.patch | 466 bytes | eiriksm |
Comments
Comment #1
eiriksmComment #2
eiriksm...just discovered another place where this is very apparent.
If you enable config translation and wants to translate a view (on admin/config/regional/config-translation), there will be a list of different "config entities"(?) there. Among them "view", which in Norwegian gets translated to something like the word "show" (as explained above). This is fixed by applying the patch above.
I am pretty sure this must be an issue to other languages also. Should be fairly easy to review this one, but feel free to ask if anyone has any questions.
Comment #3
Gábor HojtsyMakes sense to me. Not sure this should get test coverage, looks good.
Comment #4
Mark_L6n CreditAttribution: Mark_L6n commented@eiriksm, sounds like a good idea.
Here's some high-level feedback from a perspective of computational linguistics and machine translation (MT):
You're correct that's a common problem, in fact much more common than most people realize. It often is discussed under "word-sense disambiguation", "lexical ambiguity" or "polysemy" (see ACL or Wikipedia). You'll see most MT systems have problems with this. To solve this, systems look at contexts (words, domains, etc.). Problems often seen:
So, maybe more info than you need, but I think you're on the right track in setting something up that looks at context for appropriate translations.
Comment #5
alexpottI think we need to add the same context here.
Comment #6
eiriksmThat is a good point!
Tried to do a quick grep for other instances of it (might be what you just did, though) and found no other relevant t calls.
Anyway. Here is an updated patch.
Comment #7
Gábor HojtsyLooks good to me :)
Comment #8
alexpottCommitted 554034a and pushed to 8.0.x. Thanks!
Comment #10
Gábor HojtsyThanks!