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
Idea: Load languages delta #41
Comments
Thanks for raising this issue! It's an excellent question and I totally understand your use case. In some way this has been discussed in the past and the conclusion was that an automatic fallback and perhaps merge of languages isn't a good idea. The usefulness of such a feature essentially boils down to how you're using the list of preferred languages. When my fallback list is e.g. However, for Perhaps However, for all the other cases where it might make sense, we can surely explore this. (Of course the easiest solution would be to copy over all fr_FR strings to fr_CA if they haven't been translated already.) Looking at the code I think this could be achieved programmatically rather easily. I haven't tested it, but 4c78495 is what I had in mind. |
I guess you are talking about the WP administration section. It seems to me like it makes no sense for the website (front-end) to display in Spanish, Deutsch and English at the same time, no ? Maybe I'm missing something. My suggestion was only for the front-end... but it wasn't clear as I did not mention it. |
I was referring to both :-) After all the plugin works on both sides
No I'm not sure I follow 🙂 The two sentences contradict each other. Your suggestion was for the front end but it doesn't make sense? |
Let me clarify! In what case would it make sense to have such fallback:
It is already going to be weird if plugin A is only translated in es_ES and plugin B is only translated in de_DE. Right ? Maybe my proposal could be applied only it they all come from the same language. In the Dashboard, I might prefer Is is clearer ? There could be an option to apply or not the delta. :-) |
As I said in #41 (comment), it isn't the best example. I tried to exaggerate to prove a point. A more reasonable problem could be something like
That's true 🙂
Yeah, since this really depends on the context, this couldn't be done automatically for everyone. I'll experiment with adding a filter that one can use if they want this delta to happen in that specific scenario. Sounds good? |
Sounds perfect! |
@maximejobin Curious, have you ever tried my attempt at this (4c78495) on a site? Maybe it's time to revive it 🤔 |
No, I did not test it. I did not know you made that patch. Let me see if I can find a site with incomplete translations to test that use case. |
I've linked it in one of my earlier comments, but it's easy to miss, so no worries 👍 I just opened #249 to track this more easily, as I am not sure if it had a bug. Also, I obviously will need to fix merge conflicts. |
Closing this for now as there will be a |
From my understanding, a language is loaded in order of preference.
So if my preferred language has a translation, that translation is used.
In our case, we use fr-CA. But the most up to date language in French is fr-FR (bigger community and more active). It is also important to note that most plugins (almost all) are coded in English.
Let's take plugin XYZ for example:
In our case, fr-CA is our top preferred language followed by fr-FR. As a fr-CA translation exists for XYZ, it will take fr-CA. The fr-FR translation is the discarded for that plugin.
In that case, 45% of the strings showed for fr-CA will be in English (100%-55%) because the fallback will use what's in the code (e.g. __('Hello my friend', 'XYZ); ).
The idea: Wouldn't it make more sense to use 45% of the fr-CA and add the missing 55% from fr-FR. That way, this plugin's translation will be 100% in French. Maybe not 100% in fr-CA but at least it won't show English.
I'd like to contribute to the development if that makes sense. :-)
The text was updated successfully, but these errors were encountered: