-
Notifications
You must be signed in to change notification settings - Fork 115
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
multilang: strange behaviour when selecting dts templates #317
Comments
This is the order of matching from the code:
Perhaps the order of my logic is faulty |
Uhm.... I assume it's allowed that different templates have the same name if e.g. at least language differs? If so, then I think it would need to be something like this:
(then, if duplicate IDs with different languages are allowed, which would make sense, IMO)
(starting from here, one could make it better if one had an order of precedence of languages,... e.g. something like: if no lang matches, then take
last but not least:
And I'd consider the special cases like "empty language" to be identical to no matching language. |
Yes I tried to take into account explicitly language is not present in the sequence, I am not clear why the sequence you propose is better probably need some worked examples which are realistic compared to previous iterations of configuration bearing in mind really you should be matching platform, language, template type, template name and anything else is really just a guess |
Well, AFAIU your code it's the following:
Imagine a user has set lang=en and templatefoo, then he'd get no exact match, and would probably end up with the 3rd choice, right? Even though this is probably just some leftover (as it has not language) and there is a higher matching default=true version for en, which just happens to be named bar.
I think that misses at least those cases were one has a better default=false match (e.g. no matching language, but matching ID) and again, the language="" case should probably come last. However, I still don't get why in my case above, it doesn't work,... cause I do have languages all set, and there even is an exact match. |
The fallback in (2) was moved higher to support people running without languages at all, but perhaps too high |
Depends,... I would say yes, at least when otherwise there wouldn't be a template at all. Other than that, the "best" solution would be perhaps what I've wrote very above, that one could set a (server-side) preference of the order of languages, maybe implicitly, perhaps via the order in But it would be better if one had a separate setting for that, which could be only a subset of |
btw: I've just checked and when one specifies no template in the command, it indeed seems to write |
Ok so now we kind of understand the parameters - it'd be nice to work out a definitive list of orders then we can try it with some examples. I'll happily change the code but I don't want to keep changing it. |
When no template name is specified in a user’s command, a default of “1” was used so far. This makes the default name configurable, thereby working around the issues described in: KartulUdus#317
With the changes from #325, I can keep my own dts.json largely aligned with the upstream/example one (i.e. I don't need to modify the If you do want to rework this nevertheless, I'd say the order which I gave above sounds mostly reasonable to me, but to make it really perfect, one would probably need a new languagePreferenceOrder setting or so.
|
Hey.
Was playing with multilang in
develop
and noticed the following strange behaviour.For
monster
I have e.g. these (amongst others):...
So there's basically
1
(with en, however default=false) from the upstream example dts.json, than my own ones, with first oneen
with default=true some more inen
with default=false and then the same forde
.Now when I do
/language de
and set a tracking rule without any templates it correctly uses the anticipated one, but when I use/language en
it always goes totemplate1
, even if I e.g. change the order and put it behind "my" en-default.Cheers.
The text was updated successfully, but these errors were encountered: