Catfriend1 / syncthing-android

Syncthing-Fork - A Syncthing Wrapper for Android.
Mozilla Public License 2.0
1.14k stars 40 forks source link

Translations update from Hosted Weblate (conversation) #1056

Closed weblate closed 7 months ago

weblate commented 7 months ago

Translations update from Hosted Weblate for Syncthing/Android app strings (fork).

It also includes following components:

Current translation status:

Weblate translation status

Catfriend1 commented 7 months ago

@acolomb should we go for this as well before I test compile?

acolomb commented 7 months ago

Sure, why not? Just for testing, you could merge the branch locally. Or just merge the PR and Weblate will open a new one whenever new translations come in.

Catfriend1 commented 7 months ago

@acolomb I cannot build atm, getting the following error. What do I need to do to correct this, please?

> Task :app:processDebugResources FAILED
BUILD FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR: \app\src\main\res\values\strings.xml:540:5-544:20: AAPT: error: resource string/notification_type_normal (aka com.github.catfriend1.syncthingandroid.debug:string/notification_type_normal) not found.

     ERROR: \app\src\main\res\values\strings.xml:540:5-544:20: AAPT: error: resource string/notification_type_low_priority (aka com.github.catfriend1.syncthingandroid.debug:string/notification_type_low_priority) not found.

     ERROR: \app\src\main\res\values\strings.xml:540:5-544:20: AAPT: error: resource string/notification_type_none (aka com.github.catfriend1.syncthingandroid.debug:string/notification_type_none) not found.
acolomb commented 7 months ago

AFAICT there were never any strings related to notification_type_* in app/src/res/values/strings.xml, the English source language file.

Did you ever add them?

acolomb commented 7 months ago

Ah, got it. That's something that got added upstream, and I carried it over as part of the string-array replacement. But the fork seems to miss that functionality.

Should we remove the definitions from arrays.xml? Or do you want to pull in the respective changes from upstream?

Catfriend1 commented 7 months ago

@acolomb Ah I see, so it can be commented out? I'll try and check compilation.

Catfriend1 commented 7 months ago

Now it compiles well with the one array related to notifications commented out.

image

Can I leave it like that? https://github.com/Catfriend1/syncthing-android/pull/1057

acolomb commented 7 months ago

I have little knowledge about Android app development, so not sure about the Gradle warnings. But I've seem them on the upstream build as well, and it didn't hurt there. So, from my side it looks OK.

acolomb commented 7 months ago

One more thing, I guess you haven't set up a Webhook for Weblate to pick up upstream changes immediately? That would be great to speed up propagation of new strings. See here:

https://docs.weblate.org/en/latest/admin/continuous.html#github-setup

Catfriend1 commented 7 months ago

@acolomb Can I do this webhook thingy alone? Or would it be better we meet up in Discord and do this together?

acolomb commented 7 months ago

Hm... I think you can manage it according to the linked instructions. If not, sure we can connect up somehow. TeamViewer, Discord, whatever. I have a Discord account somewhere, but not actively using it.

Catfriend1 commented 7 months ago

What is the correct URL, docs state: https://hosted.weblate.org/hooks/github/ but the text says I need the weblate URL somehow. If I enter https://hosted.weblate.org/projects/syncthing/android/catfriend1/hooks/github/ it is 404.

Catfriend1 commented 7 months ago

I've added it now, without a secret. Not sure if this will work on the other side: image

acolomb commented 7 months ago

Looks good I guess. The https://hosted.weblate.org/hooks/github/ URL is correct, ast he note in the docs says. Weblate is a system which you can self-host, in which case you need to construct your own URL. But for Hosted Weblate, it's just the one listed in the docs.

Catfriend1 commented 7 months ago

How can we test communication on weblate side?

acolomb commented 7 months ago

When you push a commit, it will trigger an update on Weblate automatically. You should see an entry in https://hosted.weblate.org/projects/syncthing/android/catfriend1/fork-stringsxml/#history

Catfriend1 commented 7 months ago

Ok, I'll change a string for testing and then back? Or does this wipe existing translations like Transifex did before so I'd better not do that test and check back next time?

acolomb commented 7 months ago

No, simply do any commit on this repo as you would do anyway (doesn't need to touch any translations). Then check the Weblate history whether a notification was triggered.

No, translations are not overwritten when you change them here. What happens is that Weblate pulls in the Git commit and rebases its internal repo with translation commits onto that. Then it pushes the result to the PR branch. The rebasing can fail, however, if you are changing strings where users have already edited the translations. Or even if they're on the next / previous source line, causing Git to not cleanly merge the differences. That's why it helps to pull in translations before you start touching language files yourself, to avoid conflicting changes.

Catfriend1 commented 7 months ago

@acolomb Ok, thanks for the explanation. I'll try with a new string in https://github.com/Catfriend1/syncthing-android/pull/1058

Catfriend1 commented 7 months ago

@acolomb Cool, it worked :-).

image

Catfriend1 commented 7 months ago

@acolomb Is there a button "make new PR with updated translations now"?

acolomb commented 7 months ago

Yes, there is, but only for project admins on Weblate. Let me see if I can assign that permission to you.

acolomb commented 7 months ago

You should have access to this now: https://hosted.weblate.org/projects/syncthing/android/catfriend1/fork-stringsxml/#repository