Gadgetbridge app name for Nightly/Nopebble builds only changes for default US locale #2627
Labels
No Label
device mi band 7
activity post processing
activity/health
Android 12
Android 13
android integrations
architecture
Bangle.js
bug
changes requested
charts
details not provided
developer documentation
device amazfit band 5
device amazfit bip
device amazfit cor
device Casio
device fossil
device garmin
device gtr 2e
device gts 2 mini
device h30
device hplus
device huami
device Huawei
device liveview
device mi band
device mi band 2
device mi band 3
device mi band 4
device mi band 5
device mi band 6
device no.1 f1
device pace
device pebble
device pebble 2
device pinetime infinitime
device request
device sony
device support
device watch 9
device xiaomi
discussion
documentation
duplicate
enhancement
feature request
Gadgetbridge
good first issue
help wanted
i am developing my own app can you help
icebox
intent api
internationalisation
invalid
needs work
network companion app
new device
no feedback
not a bug
notifications
one of the 1000 issues about disconnection
pairing/connecting
potentially fixed / confirm and close
question
research
security
seems abandoned
Solved, waiting for F-Droid release
suggest to close
task
user interface / UX
wear os
weather
wontfix
Zepp OS
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Freeyourgadget/Gadgetbridge#2627
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before reporting a bug, please confirm the following:
I got Gadgetbridge from:
Your issue is:
Nightly, Nopebble (and soon Bangle.js) builds are all just called 'Gadgetbridge' in most locales outside the USA, but in the USA they are named correctly.
These non-default builds have a customised
app_name
inapp/src/BUILD_TARGET/res/values/strings.xml
so as not to be confused with each other. However, in pretty much all non-US languages, the language translations inapp/src/main/res/values-LANG/strings.xml
take precedence.Most translations include
<string name="app_name">Gadgetbridge</string>
even though this is not a translation, it's just the default value for app_name. It applies for other things too like the main activity name.More info in #2621
Fixes
app_name=Gadgetbridge
entries in the translations, and then addapp/src/BUILD_TARGET/res/values-LANG/strings.xml
for app_name in the few (5?) cases where there actually was a translation.app/src/BUILD_TARGET/res/values-LANG/strings.xml
for every language - more duplication, but this then doesn't have any effect at all on the normal build... others?
Your wearable device is:
Bangle.js
This is my first shot at this @gfwilliams , @ashimokawa . I did actually not try to localize the names yet and i did not remove unused files etc...
https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/TranslatableVariants
OK, my latest version should work as expected - the app name is modified in manifest (via gradle variables) and then in all other occurences (via code). This means that launcher and all android dialogs have correct name.
I have not tried translations yet but it should work.
One current limitation:
If one builds a "banglejs" product flavor with "nopebble" build type (i presume this would only happen during debug but not for any production release), then the "nopebble" takes priority. This could likely by solved by adding a nopebble build type to the banglejs variant :) (This is because the string replacement via code is a bit more flexible, while in gradle, one must define the matrix combinations).
Thanks! Looks good to me...
edit: I'm not too concerned about the "banglejs"/"nopebble" thing. Not sure, but does it even make sense to make "nopebble" a build flavor instead of build target now?
I think that we should rename the pebble provider by default in the Bangle.js Gadgebridge. If not, the Bangle.js Gadgetbridge will silently fail to install on mobile devices where either Gadgetbridge or Pebble app is installed - which given the demographics, can be some percentage of the user base.
One more comment: most likely what i do via code can be done via gradle, thus we could perhsps remove the java code. This would be better (less room for error) but a bit harder to grasp (one is using string resources which actually do not exist.) And, a bit of special syntax in the xml is required:
tools:replace="android:label"
must be added.I am not 100% sure about the possibility to remove the code because this often behaves in very unpredictable way and i did not test it. Right now, it is working as is :)
What does everyone think about this? I'm happy with whatever, but I'd quite like to get this (or another solution) merged :)
I would love to try the "no code" solution but I have been deeply consumed by dayjob... and will be for at least another 14 days. We can merge this for now and look at different ways later too. I will look at it tomorrow, at least to rebase and merge.
Here is a new branch partially based on my previous test and trials, which should do exactly what we need but all the definitions are now in gradle, no extra java code, thus eliminating potential bugs.
https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/TranslatableVariantsWithoutCode
@gfwilliams can you please test if this is still working for you and provides a solution to this issue? Thank you!
Thanks!
I just tried this and the app is still just called
Gadgetbridge
for the British translation. While you had removed the line<string name="app_name">Gadgetbridge</string>
fromstrings.xml
, it's still defined in all the translations so I guess those overwrite everything (same deal as before)?However, if I replace
"app_name"
/etc with"..._generic"
in all the translations it's all good. Hope you don't mind but I just pushed the changes to https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/TranslatableVariantsWithoutCode to save some troubleI'm pretty happy with that as a solution if you are?
@gfwilliams thank you! Sorry for the delay. It is now merged into master. I have again tried different variations and the solution with code had a tiny bit more flexibility but i think what we now have is good. Please still try with our configuration and different language settings on your phone, on my devices this seems OK.
Most likely this issue can be closed.
Sorry - I forgot to get back to you. Yes, I've tried what is currently in master and this all looks good now!
@gfwilliams
Thank you!