You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes in weblate-language-data can turn existing languages into aliases (for example, in WeblateOrg/language-data#1427). This will have an immediate effect on new installations, but will do nothing on existing installations.
Describe the solution you would like
The existing installation language definitions should be updated if UPDATE_LANGUAGES is turned on.
Factor out logic from the move_language management command to a module.
Better handle integrity errors in that code (when both languages exist in a component), most likely by emitting a warning.
Migrate content for any existing aliased language to the alias target in Language.objects.setup using factored out code.
Remove blank aliased languages.
The legacy codes in the URLs will be automatically redirected by the existing middleware, so no change is needed for that.
Describe alternatives you have considered
No response
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
How do we emit a warning when move_language is executed on Language.objects.setup()? It makes sense to log warning to console when executing an admin command, but what's the common way if it's triggered after migrations. Shall I just use the Alert model ?
Using Alert sounds like a good idea, but not in the setup path. I think the logic should be the same as with existing setup. When invoked manually, it will print, when not, it will just do nothing (current implementation), or use weblate.logger (that would have to be implemented).
As for the Alert, there already is DuplicateLanguage which pretty much covers this situation (you would get it after applying the changes), so it probably could be extended to cover this as well.
Describe the problem
Changes in
weblate-language-data
can turn existing languages into aliases (for example, in WeblateOrg/language-data#1427). This will have an immediate effect on new installations, but will do nothing on existing installations.Describe the solution you would like
The existing installation language definitions should be updated if
UPDATE_LANGUAGES
is turned on.move_language
management command to a module.Language.objects.setup
using factored out code.Describe alternatives you have considered
No response
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: