-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add a test locale #3530
Add a test locale #3530
Conversation
fbbf7dc
to
4631edc
Compare
Thanks, this sounds good. Although just scanning I feel like long day/month might be a bit on the high side? As you say it would be good to have a test. We do have a sanity test that runs when the locale html file is run: BangleApps/apps/locale/locale.html Lines 102 to 125 in 4631edc
It might be good to have the checks in there, and maybe an explicit |
Those limits are set by the longest real month and date. I don't remember which language it was, but I can find it if you want me to. Obviously you could just set a shorter limit and thereby force a few languages to concatenate the names, but I'm not convinced that it would be a good solution. You'd be removing information that apps might want to use, and if they want something longer than the abbreviated name, but shorter than the full name, they can just cut the name at an arbitrary length.
Yeah, I was thinking the same. |
Ok, sounds good - as you say as long as the short version is actually short, that should probably do |
@gfwilliams I would actually want to move the sanity check out of the html file and into a separate script. This would allow the check to run as a Github action that can catch mistakes before they are merged. You have also mentioned that you want the app loader to be as light on resources as possible because it is used on budget phones, so it would make sense to not run the same sanity check over and over on every single phone for every single locale. Do you agree? |
Ok, yes, that's fine. I think realistically the sanity check is pretty minimal and only runs when loading the locale app, so it's not a big deal - but running as a github action would negate the need for it (maybe just do it from the sanitycheck script to avoid having to modify github actions as well as |
@gfwilliams now that we added a formal linter, I think this is ready to be merged? One thing to note: I chose to use the french 'h' in this locale, because I wanted to make the time strings as wide as possible. I don't think there is anything wrong with adding it to a test locale, it will probably just nudge app owners to implement some workaround for uncommon formats, which I think is good. But if you think it should not be in here, I can get rid of it. |
Looks good, thanks! As you say I'm unsure about the 'h' but hopefully it's not a big deal unless someone starts just filing hundreds of issues against existing clocks without offering fixes :) |
I think it would be useful to have a test locale for when you want to make sure your app can support all locales, even those with very long strings. Right now, you have to guess how much space to give each string, and that is a tedious and error prone method.
The length of each string in the test locale is as long as it is allowed to be, according to these limits:
If @gfwilliams agrees with these limits, I think it could be useful to document them somewhere, and also add some code to verify that they are being followed.
The limits support all existing locales, except a few that have unnecessarily long strings that you cannot expect a small watch to display. I have checked each case, and it is possible to make those strings shorter.
Character count is not the only issue though. The width and height of the characters can also have a big impact on the visual size of the string. I have made sure to use tall and wide characters such that the test strings are at least as big as the biggest real locale strings.
I have tested a bunch of apps with the test locale, and most support it, so I think it is a good middle ground that is not too restrictive on the string lengths, but also doesn't require apps to use too much screen space.