-
Notifications
You must be signed in to change notification settings - Fork 154
Description
From this comment by @robnadin:
Sorry to comment on up such an old commit, but I'm just wondering why this was changed? As far as I know, aapt automatically converts string names containing dots into underscores, so for example the following key:
network.errorwill be converted to:
R.string.network_errorOur workflow would like to take advantage of using dot syntax so we can generate structured keys for iOS using SwiftGen but keeping the validation of the twine .txt file intact. Currently, running Twine with validation checks spits out numerous Found key(s) with invalid characters: warnings etc.
One consideration we need to maintain is how this affects all formatters, not just Android's.
I would like to propose that we:
- Get a list of valid / invalid characters for all formatters.
- Update
validate-strings-file
for a common set of characters. - Update
validate-strings-file
to support the--format
option to validate the strings file for a particular format. Thus, if--android
is passed in, the Android formatter can provide a list of valid or invalid characters for string keys.
I would love to be able to add support for invalid characters by doing our own replacements (like replace <
with _
when we generate the localization file for a format that does not support <
). However, this adds many complications with consume-localization-file
which may not be worth the complexity and effort.