sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.37k stars 1.05k forks source link

Mismatched Language Display in Update Screen #2437

Closed andrevinic closed 11 months ago

andrevinic commented 1 year ago

Summary

I've encountered an issue with the language display on the Update screen, which is accessed through the "Check for Updates" option. Despite configuring different languages in the update_pkg.xml file, there seems to be an inconsistency in the language display for the Title, Subtitle, and release notes, especially after altering the system language settings. In some instances, the Title and Subtitle appear in one language (e.g., English), while the release notes are displayed in a different language (e.g., Spanish), creating a disjointed user experience.

Steps to Reproduce:

Expected Behavior:

Actual Behavior:

Observations: Language Transition Behaviours:

Note:

I would greatly appreciate it if others could test this as well and contribute additional insights or observations to this issue. Your collaboration will be invaluable in resolving this matter more efficiently.

Version

2.4.2

zorgiepoo commented 1 year ago

If you change the system language, you need to restart the app. Please ensure you are doing that step. If you are not, then this is expected behavior.

andrevinic commented 1 year ago

If you change the system language, you need to restart the app. Please ensure you are doing that step. If you are not, then this is expected behavior.

Hello! Yes, I had restarted the app in all scenarios.

zorgiepoo commented 1 year ago

I tried altering the Sparkle Test App to test the xml:lang on the release notes. It seems like all releaseNotesLink elements need to have a xml:lang specified, including the English one. I wonder if that is your issue here?

And basically the issue here is the release notes language may not be picked to what you expect by Sparkle. The localization of the heading labels, which are not specifically picked by Sparkle, are always correct. The "transitioning" part from X to Y shouldn't really matter per my above comment.

Amazingly, the code to pick the proper XML element based on the system language hasn't changed since 2008 when it was first written.

andrevinic commented 11 months ago

@zorgiepoo thats not the issue. I'm not having problems with the releaseNotesLink tag,

in the update_pkg file, I have and in other langs like

That is inside and is inside

Everything thats inside is related to the Updater release screen, I've added in like 5 langs there.

The problem happen when we keep changing System lang, as described, it mixes whats inside the Updater release notes, between spanish and english.

Sometimes I switch to italian or german and it switches correctly title/subtitle + release notes, but always mixes when it turns to english, even though the lang before was not spanish, it gets from the spanish one.

Do you have any other suggestion here?

Thanks!

zorgiepoo commented 11 months ago

I don't understand. Sparkle controls release notes localizations via releaseNotesLink or description elements and you're saying you're not having problems with them.

Post screenshots and the contents of your appcast and what turns out to be unexpected.

andrevinic commented 11 months ago

@zorgiepoo I'm are using description elements.

For example,

 <!--English description-->
      <description xml:lang="en"><![CDATA[<!DOCTYPE html>

or

 <!--Spanish description-->
      <description xml:lang="es"><![CDATA[<!DOCTYPE html>

Then, the Updater screen has the english title, subtitle english, but the notes are in spanish. I mean, when I change the System Language back to English, after switching to ANY other language.

Do you have any idea?

zorgiepoo commented 11 months ago

On macOS 13.5.2 (22G91), I can not reproduce the issue in Sparkle's test app if I use:

<description xml:lang="en"><![CDATA[This is an ENGLISH release notes.]]></description>
<description xml:lang="es"><![CDATA[Estas son las notas de la versión en español.]]></description>

Obviously you need to restart the app after changing the system language.

However I should double check how the picking-the-localization code works in Sparkle. You are free to try debugging it as well since you say you are reproducing an issue.

zorgiepoo commented 11 months ago

Note I am changing this code in https://github.com/sparkle-project/Sparkle/pull/2440 to better handle the case when there is one of several elements with no xml:lang specified. And also add better error reporting.

zorgiepoo commented 11 months ago

Retry with https://github.com/sparkle-project/Sparkle/pull/2440. The ReadMe explains how to grab a nightly build of Sparkle or you can compile it yourself. (The change is not available for package managers yet). The change has more tests and also logs out any potential errors when checking for localizations.

If there's still an issue please paste the full appcast item, macOS version, screenshot/visual of what's wrong here.

andrevinic commented 11 months ago

@zorgiepoo thanks! I'll make a test.

thanks!

andrevinic commented 11 months ago

@zorgiepoo I could test the latest version using the TestingApp, seems that the problem is fixed, I even compared with old versions and I could face this issue there and now in the latest commits it does not happen.

When are you planning to release the 2.5.1 with this latest fix?

Thanks!

zorgiepoo commented 11 months ago

Thanks, will try to make a release in the next few days

zorgiepoo commented 11 months ago

I released 2.5.1 with the changes.

andrevinic commented 11 months ago

Hi @zorgiepoo thanks! Just a small detail, When I change the system lang to spanish language, now only the subtitle keeps in english, and release notes correctly in spanish I have tried switching to italian or portuguese, and the subtitle works, and release notes correctly in italian too When switching to Korean, title AND subtitle keeps in english, and release note correctly in korean.

Could you please double check if the title and subtitle are switching correctly to those languages? ps: the prior problem of this issue is fixed because the release notes was not following system lang, but now it does work correctly.

Thanks for the support.

zorgiepoo commented 11 months ago

It would be a lot better in general if you had upload screenshots or share the app in question. I would better understand what you mean when you say "subtitle" and could inspect any potential visual issues.

Screenshot 2023-10-18 at 6 37 01 PM

This is Spanish for the Sparkle Test App (the release notes were not localized). As you see it works correctly. Italian and Portuguese works. For Korean, it looks like nobody translated the window title ("Software Update") but everything else works. Feel free to open a PR to translate the window title for Korean if you want.

Sparkle only directly controls the localization for the release notes, the rest is handled by Cocoa, provided that people have translated those strings. Your app may also need to properly "enable" the language for Sparkle's window to use those translated strings (if your app is using NSLocalizedString() in other places besides Sparkle and it works there, then it's probably fine; otherwise, it may need to specify CFBundleLocalizations). Also the app needs to be restarted if the system language changes.

edit: added more details