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 String Dict files with NSStringVariableWidthRuleType #4

Open
kudalies opened this issue Nov 24, 2018 · 2 comments
Open

Support String Dict files with NSStringVariableWidthRuleType #4

kudalies opened this issue Nov 24, 2018 · 2 comments

Comments

@kudalies
Copy link

Support .stringdict files with string rule type: NSStringVariableWidthRuleType

See the example below which doesn't load during lint operation.

?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CLAM_CHOWDER</key>
	<dict>
		<key>NSStringVariableWidthRuleType</key>
		<dict>
			<key>1</key>
			<string>Clam Chowder</string>
			<key>25</key>
			<string>New England Clam Chowder</string>
		</dict>
	</dict>
	<key>CHICKEN_NOODLE_SOUP</key>
	<dict>
		<key>NSStringVariableWidthRuleType</key>
		<dict>
			<key>1</key>
			<string>Chicken Noodle</string>
			<key>25</key>
			<string>Chicken Noodle Soup</string>
		</dict>
	</dict>
</dict>
</plist>
@kudalies
Copy link
Author

kudalies commented Dec 2, 2018

After more research on this NSStringVariableWidthRuleType in conjunction with the pluralization string format;
They do not operate together on the same key, NSStringLocalizedFormatKey always takes precedence and will be processed instead of NSStringVariableWidthRuleType if both are present.

Therefore a stringsdictentry can be either a pluralization format string or a variable width string.

Thinking the best solution for this is to provide a model that combines these two types together.
In the meantime, we can maybe just ignore NSStringVariableWidthRuleType entries until we can support both.

@kudalies
Copy link
Author

kudalies commented Dec 2, 2018

Only apple dev doc on stringsdict https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/StringsdictFileFormat/StringsdictFileFormat.html

It's old and outdated, and there is a related rdar for updating this doc: http://openradar.appspot.com/38627216

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

No branches or pull requests

1 participant