Add option to disable case-changing of language codes #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset adds a new setting -
REFORMAT_LANGUAGE_CODES
, defaultTrue
, which we can use to control whether w-l-s will reformat lang codes as part of the Smartling sync.By default w-l-s assumes the Django project will be using Django's core default of all-lowercase language codes (compared to Smartling's mixed-case approach) and forces all lang codes to the relevant style depending on the direction of travel. This change allows us to skip that step when importing strings back into Wagtail, (and the equivalent step when sending lang codes to Smartling, too, just for consistency and no surprise).
Testing
Manually tested locally. I have a stash locally with some tests for test_utils.py but neither
@override_settings
normock.patch.object
seem to work for setting fake settings during a test - the former gets ignored and the latter blows up because the patched attribute can't be deleted/changed. If anyone has a tip about that, I'd welcome itResolves #17