-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
feat: Add translations #2963
feat: Add translations #2963
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
2816acd
to
f7d6f36
Compare
Is the cron job setup to run every hour? I may need an adjustment. |
The cron job runs at the first of every month, as requested by osumatrix |
I think it's one of the * values, where it's uploading every hour of the first day of the month. If the cron isn't changed, it might stop syncing on April 2nd. |
Right, because the minute value resets every hour Opened a PR #2967 |
Any idea why some strings changed here are not syncing with Crowdin? for example, here on GitHub dev a string is: But on Crowdin it still shows the old (incorrect) prior value: |
Oh, just realized something, for the repo to be syncing to Crowdin, the Sync Crowdin needs to be run, we may need to add two different workflows if you want syncing down to the repo to continue being monthly - but this may be unrelated to your issue as the workflows have just run, going to check now |
2fb7b50
to
1b76f90
Compare
@Ushie Shouldn't the same workflow push sources? I think that's a parameter of the action that is currently set to true. |
The way things currently are, the, source in crowdin will get updated monthly, it should be more frequent so that people can translate on the go |
That seems reasonable. In that case the workflow could skip over the step that pulls translations, but it seems unnecessary not to, which is why the workflow can run weekly. |
1b76f90
to
2d4e4e3
Compare
If there is a way to just push changes to Crowdin, that could be done daily. Because if someone is translating old outdated strings they are wasting their time since their translations will be outdated when the GitHub -> Crowdin push later occurs. (This is going in right now, since Crowdin still has old strings). It also would be nice if no strings were changed on Dev, then do not push to Crowdin. That would prevent the Crowdin activity page from showing meaningless "ReVanced Bot compiled but changed nothing" events. |
Syncing to crowdin does not have to be bound by a cron, it can be triggered by modifications to the source file, this also solves the problem you stated at the end of your message |
Yeah that is true. Did we figure out why it's not pushing changed strings from GitHub -> Crowdin? |
I got carried away with something meaningless and forgot to look, I'm at work now, I'll see if I can RDP home and check |
2d4e4e3
to
07dc50e
Compare
29f8b71
to
731b490
Compare
Duplicate keys are a problem with Crowdin. Previously there was a debug string in multiple apps, and it causes Crowdin to get confused and every time strings were synced (it would randomly pick one of the duplicate strings, and delete the prior translations of the other strings). This only happens when the same string path is used in multiple apps. |
For now, add a hard coded list of the 5 digit locales found in YT? so |
The add resources patch is not specific to YouTube so making YouTube specific changes to it doesn't sound good. Are these three digit country code standardized? If so, the add resources patch could be changed to support that. |
Yes the language + region 5 digit codes are standardized, but the issue is YT using a mix of 2 and 5 digit codes. So when merging the files, AddResourcePatch has to somehow figure out how to sometimes go from 5 digit codes to 2 digit codes so it merges the right file. That is not very app agnostic either. Just to get this working, I am going to try hard coding these few specific languages to a list of of optional 5 digit languages. this can improved later. This could be improved by allowing specific patched apps to provide their own mapping (similar to how Crowdin has language mappings). For now I think the priority is getting this working and worry about improving the design semantics later. |
I think a solid solution would for the add resources patch to collect all available translations in addition to the Java language codes. That was it will support any app. The only issue is, if an app is using a language code but has no translations for it, then the patch would never know that this translation exists. |
This is not quite as easy as using a hard coded list of regions to allow (or at least, I can't figure out an easy way to modify add resource patch). I think the solution here is:
@oSumAtrIX any suggestions? For now, short term solution right now is to only use translations for languages with 2 digit codes (which is everything except Brazil Portuguese and all the Chinese translations) |
Actually, for now this can probably work by specifying a map of Crowdin -> Android locale names. I'll try that as it's simple and will get this out the door. Can make this better later. |
b2112b0
to
e079df2
Compare
e079df2
to
044077d
Compare
Only one last thing: "Change cron job to run on dev branch and not main branch" Anyone want to give this a go? I'm not so familiar with what needs to be done here. |
I don't understand why, but if the Crowdin setting "do not export untranslated strings" is enabled, it fails to export a language unless all strings are translated. So it breaks translations if it's not 100% translated. So I have that setting off for now. |
Refer to e2a9b1e#r143615849 Are you sure the syntax is right? |
I have no idea what is the right syntax. I don't use yaml often. Maybe change this to push to crowdin on every commit to dev? That's usually not more than once a day or so. Everything else seems ok so could merge and fix the crowdin sync later |
That's the idea. It should sync every commit to dev but only if committed to a string path. I'll take a look at the workflows in a bit. In yaml you can create objects and lists and nest them in other objects: list:
- item1:
propertyOfItem1: 1
- item2:
- item2_1
|
I think it should work now |
Thank you for contributing to ReVanced. Join us on Discord to receive a role for your contribution. |
# [4.11.0-dev.2](v4.11.0-dev.1...v4.11.0-dev.2) (2024-06-27) ### Features * Add translations ([#2963](#2963)) ([69ea6f3](69ea6f3))
Yay 🎉🎉 |
Sync translations from crowdin.com/project/revanced
Issues to sort out
<notranslate>
to indicate do not translate) edit: not available with project plan, and using a random placeholder tag gives a different and undesired behaviorupdate_as_unapproved
to project config to preserve existing translations during GitHub -> Crowdin sync edit: this change will not be needed./he/Strings.xml
to/iw/Strings.xml
after pulling from Crowdin to GitHub. YT uses the olderiw
and Crowdin uses the newerhe
. If both old and new language files are on an phone installation then only one code might be used and Hebrew strings will be partially broken. Copying to both or using onlyiw
fixes this. Edit: For now this is fixed by using a Crowdinghe
->iw
mapping, and this works for Manager/YT/Twitch since none use anyhe
resources. If a new app is added in the future that does usehe
then this may need to change, but for now this is simple and it works./ur-IN/Strings.xml
to/ur/Strings.xml
after pulling from Crowdin to GitHub. Then removeur-PK
from Crowdin (use one Urdu translation for all countries). Edit: a Crowdinur-IN
tour
mapping was added