-
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
More space savings #7181
More space savings #7181
Conversation
Marking this as a draft, we can pick and choose from these improvements when we have a need for space ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Neradoc what do you think of the French apostrophe change? I'm not sure we could get the regular translators to do that, or if it looks wrong.
As far as I know it's only ever auto inserted by software, like Word, a CMS and such. Nobody is gonna notice the difference. It's also not even used consistently in CP. |
I also had to respell an œ as oe, and made changes in a few other translations as well. we could look into a different way of storing the data (such as utf-8) but last time I looked there was a real inconvenience to storing I also noticed that some other languages, like ru, use just a small number of codes well outside the 0-255 range. A much less complicated rule could remap the 160..255 values to those code points and potentially save space. In the board I've been using as my benchmark (adafruit_proxlight_trinkey_m0), with all the uint8 fixes, the fullest languages are ru and el (greek) which could benefit from this treatment. |
@jepler Did you back out all the French spelling changes? That was the thing I was worried about. If so, I'll approve. |
Needs a re-merge from upstream. |
MP_REGISTER_MODULE would use identifiers like "MODULE_DEF_MP_QSTR___FUTURE__" which would in turn cause a QSTR to be generated for it. This wasn't desirable, because the qstr would never be used. This clears out quite a bit of flash storage on the proxlight trinkey.
These are turned into TRANSLATE() messages now, so the qstr version would not be used.
I'll rebase. The french translation leaves œ but still changes a smart-quote to a regular quote. |
3a0e6b1
to
b82767d
Compare
.. it makes mchar_t, the type of storage needed for all the code points in all translation messages, be an 8-bit type instead of a 16-bit type
This saves a few hundred bytes on the affected translations, such as `el` which shrunk from 186152 to 185588 bytes (564 bytes saved).
b82767d
to
d2e2a61
Compare
@dhalbert ready for hopefully one last review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! More bytes to use up :)
After merging this, I got an email from weblate: Could not merge the repository.Weblate could not merge upstream changes while updating the repository. Auto-merging locale/nl.po Auto-merging locale/fr.po Auto-merging locale/fil.po CONFLICT (content): Merge conflict in locale/fil.po Automatic merge failed; fix conflicts and then commit the result. (1) Typical workflow for fixing merge conflicts
|
Two big ones:
We should add a check for langauges that we expect all the chars to fit in
uint8_t
actually do, otherwise firmware grows by up to 500+ bytes...