snapdrop
snapdrop copied to clipboard
Internationalization support
I am very lucky to find snapdrop. It can now fulfill all my needs. But whether the ui language can support other languages, or define a configuration file. It is currently found that the text on the ui exists in multiple places. client/index.html // many strings client/script/network.js //notify info client/script/ui.js //notify info server/index.js // random name module
random name module, I found an alternative module
I just hope that every time I follow up the snapdrop update, I don’t have to repeat these operations.
Hey, we try to do this in the android app via js
https://github.com/fm-sys/snapdrop-android/issues/69
will be compatible with snapdrop.net as well and can be integrated :)
can you provide a comprehensive list of all strings that need to/can be translated (in the body
) and the css unique identifiers (mostly ids) as well as the attribute that needs to be modified - would be awesome!
example
document.querySelector('#a[href="#about"]').setAttribute('title', lang.about);
document.querySelector('#theme').setAttribute('title', lang.theme);
document.querySelector('#notification').setAttribute('title', lang.notification);
document.querySelector('#install').setAttribute('install', lang.install);
document.querySelector('x-no-peers h2').innerText = lang.open;
https://github.com/ueen/snapdrop-android/blob/localization/app/src/main/assets/localization.js#L4
Indeed the best would be if we could integrate it directly into snapdrop.net instead of inside the android app. But if we want to go that way Snapdrop should use a localization tool like crowdin (with an automated update work flow for the webserver preferred).
The project isn't so big, so a web based localization tool like crowdin and automated update work flow is not really necessary and it's just too much. Adding new strings is almost non-existent and they are not being modified as well. All it takes is one qualified translator who submits a pull request and the localization for a language is completed, of corse people can edit it if there was some thing wrong but as long as the translation is accurate there is no need to edit it even for decades. A .po
or .json
file is just enough.