-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Only translations for enabled extensions should be loaded from language pack #2020
Conversation
…ge pack. fix flarum#1837 Co-authored-by: Daniel Klabbers <[email protected]>
OK, I found one problem. Extensions that use translations but does not register I'm not sure how to proceed with this. Personally, I would just move these translation files to extensions, like in every other 3rd party extension - it seems to be more consistent and pragmatic (you don't need to open 2 PRs every time you add a new setting to extension, and you can release extensions and language pack independently). |
Is there a reason why core extensions don't use Locales? |
I'm personally in favor of moving translations to their respective extensions. |
Should this be split into a separate issue? |
Another reason to do this is that English fallback (#1961) will not work for these extensions, since there will be no English translations available (unless you have English language pack installed and enabled). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that this works, and I think it's a good idea!
There was lots of discussion about this when we made that decision. I don't remember the reasoning, but I do remember it was a very deliberate decision, weighing trade-offs and all that. Could somebody do me the favor and try to dig up that old discussion? It must have been with participation by |
Suggestion: call the Locale extender in each of the core extensions even if they have no locales files so that they clear the cache. That way we can ship this bug-free without having to make an immediate decision on whether we move language files out of the English pack. Maybe we need an additional method on the Locale extender so that we can register an empty locale file list without having to create an empty |
We just talked about this in our dev meeting.
@clarkwinkelmann I think that won't be necessary. For the current code in the extender, any directory without YAML files should do - and it might even work with non-existing directories. 😁 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Possible follow-up tasks for interested people (hint hint @rob006 @clarkwinkelmann @askvortsov1): Updates for bundled extensions
Documentation update |
- Early returns - Comments - Write variables only when needed Refs #2020.
fixes #1837
replaces #1954
This is continuation of #1954. I fixed condition for detecting core files (
validation.yml
andcore.yml
) and tested this locally - it is working as expected.