@fastfinge To localise the settings panel: import addonHandler, call addonHandler.initTranslation(), and then wrap all user-facing labels (e.g. text of checkboxes) in a call to the magic underscore (_) function.
E.g. _('&Maximum number of history entries (requires NVDA restart to take effect)')
@jscholes We are not using scons. We are not using the NVDA addon template. We are not using anything even vaguely resembling a sane build system. See build.cmd and build.py and cry. In other words, if it needs to happen, I need to do it myself.
@fastfinge No, but I did forget one thing: you should put a # Translators: ... comment on the line above where some user-facing text is used for the first time, explaining what that text is for. E.g.:
# Translators: the label for the button to update community dictionaries from GitHub
@fastfinge Ah... well: there is a translation workflow which will pull the translatable strings out of your add-on, put them somewhere for translators to translate, and then push the locale files back into your add-on. What I'm unsure about is whether they'd accept Eloquence as an add-on in that system.
@fastfinge Indeed. Probably easiest to have people clone the repo, pull out the translatable strings into a file using an appropriate tool (or do that yourself and commit it), compile their own translated strings file, and contribute the textual and compiled versions in a PR.
Even though you're not using the add-on template, you can probably reuse the translation-related utilities from it.
@jscholes Yes, this is the way. Unfortunately I only speak one language, so I can't generate a translation, and I can't switch my NVDA to another language to test the translation. So this work is going to have to fall on someone else, I think. I'm not confident enough in myself to release code I can't really test. I make enough silly mistakes as it is, because I'm not actually good at this and just do it anyway.
@fastfinge You don't really need to test the translations themselves; string selection happens via well trodden code paths inside NVDA. As long as the files end up in the right places (which are documented), it will work.
But I agree with your wider point about the rest of it. I would start by at least making sure the code is set up in the ways I described if it isn't already, because there'll be no translation at all without those bits. And then hope someone can come along to fill in the rest.
@jscholes It is not. I'll push the code changes soon. I assume doing that won't break anything if no translations or translation infrastructure exists? Like, what happens if you set your NVDA to Spanish, but no Spanish translation is available? Does the addon just refuse to load?
@jscholes Thanks! This has been helpful. :-) I feel like a sighted developer trying to make something accessible LOL. I have no idea what I'm doing and no way to test it.
@fastfinge Don't tell anyone, but localisation is one reason I don't like working on software for the community. Not because I don't think it's critical; obviously people should have the thing available in their language.
But the common tools are just so... hacky. They feel like they were built with an order of priorities that went developer, translator, user, when I think user and translator are far more important.
As a result, the developer experience isn't actually that great—relying on magic global state and functions as it does—and translations can end up with anglicised word ordering because the English-speaking developers and tools get in the way.
@jscholes The trouble is, if you make it harder for developers, people like me will never do it at all. Not because we don't care, just because we're stupid and this is a hobby. In an ideal world, translators could somehow translate the text without requiring the developer to do anything but accept a pull request. Again, not because I don't think it's worth the effort, but just because I don't want to write code I can't test.
@jscholes We also aren't technically supposed to host the eloquence dll files on github. That's why the build process is...the way it is. So that when the repo that contains them gets pulled down, we can get them elsewhere with a quick change.