Skip to content
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

Support for legacy .strings and .stringsdict file formats #20

Merged
merged 14 commits into from
Jun 9, 2024

Conversation

liamnichols
Copy link
Owner

@liamnichols liamnichols marked this pull request as ready for review June 2, 2024 21:21
@liamnichols liamnichols self-assigned this Jun 3, 2024
@liamnichols
Copy link
Owner Author

Detecting the development language is not so straightforward.. Need to ignore others.

@liamnichols
Copy link
Owner Author

It seems that a SPM environment will properly propagate the defaultLocalization into the DEVELOPMENT_LANGUAGE build setting, which can be read by the CLI from the environment variables.

It does however prevent us from filtering the build inputs to ignore other languages... An acceptable tradeoff maybe?

@liamnichols
Copy link
Owner Author

Introduced an InputParser that takes the DEVELOPMENT_LANGUAGE into account when reading .strings and .stringsdict files from the inputs. This ensures that it doesn't try to load other languages.

The downside is that all .strings/.stringsdict files are considered inputs to the plugin, which means that the plugin will re-run when translations change even though they won't have an input on the generated source, but that is considered a reasonable tradeoff to get this legacy support out there.

@liamnichols liamnichols merged commit 2158274 into main Jun 9, 2024
6 checks passed
@liamnichols liamnichols deleted the ln/legacy-strings branch June 9, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for reading legacy strings files and providing fallback strings
1 participant