Bug 160386 - All <switch> translations overlap in imported SVG
Summary: All <switch> translations overlap in imported SVG
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+ Master
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:24.8.0 inReleaseNotes:24.2 tar...
Keywords: filter:svg
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2024-03-27 07:56 UTC by Stéphane Guillou (stragu)
Modified: 2024-04-12 04:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
sample file (591 bytes, image/svg+xml)
2024-03-27 08:53 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2024-03-27 07:56:29 UTC
I'm not sure how this could be best handled, but I'm sure we can make it better somehow.

Steps:
1. Import https://commons.wikimedia.org/wiki/File:Military_Symbology_Guide.svg into e.g. Draw

Result: all translations, stored with the <switch> element, are shown at the same time.
Firefox, GNOME Image Viewer, Chromium, Inkscape only show the English translation. I'm not sure if any of these apps behave differently depending on the system's or app's locale.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1344e6261a1d856c71eca1e0cc29215a586bf335
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Xisco, what do you think?
Comment 1 Stéphane Guillou (stragu) 2024-03-27 08:10:36 UTC
The file contains <text> elements with the language codes as systemLanguage="en", systemLanguage="fr", etc. inside the <switch> element.
Comment 2 Xisco Faulí 2024-03-27 08:52:05 UTC
Yes, this is related to 76f50549f4898313ef4a18ce32d1f0a625ce766d
Comment 3 Xisco Faulí 2024-03-27 08:53:38 UTC
Created attachment 193335 [details]
sample file
Comment 4 Stéphane Guillou (stragu) 2024-03-27 09:43:48 UTC
Same on Windows 11 with LO 24.2.1.
Comment 5 Commit Notification 2024-03-27 22:45:19 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0a2535ceb06bb9233bc2eeee9158d4c9d2513abd

tdf#160386: Add support for switch element

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Stéphane Guillou (stragu) 2024-04-03 05:57:29 UTC
Thank you Xisco, fix verified in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 069bf61cea5e3aea07ffd5a1bb9f55324651cb35
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Should a follow-up ticket be opened about supporting language variants as well?
Comment 8 Xisco Faulí 2024-04-03 09:02:03 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
> Thank you Xisco, fix verified in:
> 
> Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 069bf61cea5e3aea07ffd5a1bb9f55324651cb35
> CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> Calc: CL threaded
> 
> Should a follow-up ticket be opened about supporting language variants as
> well?

Can you please test attachment 193335 [details] on your side to see what is displayed for you with different svg viewers ? It should display G'day! for australian variant
Comment 9 Xisco Faulí 2024-04-03 09:09:02 UTC
OTOH, The patch has been backported to libreoffice-24-2 in https://gerrit.libreoffice.org/c/core/+/165438, so it would fit better in the 24.2 release notes once it's merged.
Comment 10 Stéphane Guillou (stragu) 2024-04-03 09:20:18 UTC
(In reply to Xisco Faulí from comment #9)
> Can you please test attachment 193335 [details] on your side to see what is
> displayed for you with different svg viewers ? It should display G'day! for
> australian variant
For some reason, I see the en_US variant "Howdy" even though I use a en_AU locale. I tried GNOME Image Viewer, Firefox, Chromium, Inkscape, GIMP, KolourPaint.

Output of `locale`:

LANG=en_AU.UTF-8
LANGUAGE=en_AU:en
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=

(In reply to Xisco Faulí from comment #9)
> OTOH, The patch has been backported to libreoffice-24-2 in
> https://gerrit.libreoffice.org/c/core/+/165438, so it would fit better in
> the 24.2 release notes once it's merged.
I can move it when merged.
Comment 11 Commit Notification 2024-04-08 14:56:34 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/8575b792c32613e44324606393cf7a6f136472b3

tdf#160386: Add support for switch element

It will be available in 24.2.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Stéphane Guillou (stragu) 2024-04-12 04:26:41 UTC
(In reply to Xisco Faulí from comment #9)
> OTOH, The patch has been backported to libreoffice-24-2 in
> https://gerrit.libreoffice.org/c/core/+/165438, so it would fit better in
> the 24.2 release notes once it's merged.
Done:
https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F24.2&type=revision&diff=748150&oldid=748144