-
Notifications
You must be signed in to change notification settings - Fork 69
Correctly handle the "zh-Hans" language (bsc#1238584) #2314
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
Changes from 21 commits
e7ffbe3
1761d09
01aab00
80d6724
30efeca
ff59cd1
cf09453
84fc559
23d60ae
db92a08
97a22da
d000071
8877c57
c20b1d6
990c94a
ad62d2d
75bb493
b7cf3e4
1279a9c
6505471
205438e
83a3e05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| ------------------------------------------------------------------- | ||
| Wed May 7 07:07:33 UTC 2025 - Ladislav Slezák <[email protected]> | ||
|
|
||
| - Fixed locale cleanup to not delete all locales | ||
| (related to bsc#1238584) | ||
| - Keep only the UTF-8 locales, non-UTF-8 are not supported | ||
|
|
||
| ------------------------------------------------------------------- | ||
| Tue May 6 14:14:50 UTC 2025 - Imobach Gonzalez Sosa <[email protected]> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| ------------------------------------------------------------------- | ||
| Wed May 7 07:07:10 UTC 2025 - Ladislav Slezák <[email protected]> | ||
|
|
||
| - Use the correct locale format in the Intl.ListFormat.format call, | ||
| if it fails use a fallback formatting function to avoid a crash | ||
| (bsc#1238584) | ||
|
|
||
| ------------------------------------------------------------------- | ||
| Mon May 5 14:50:48 UTC 2025 - David Diaz <[email protected]> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,9 +45,9 @@ local-npm-registry %{_sourcedir} install --with=dev --legacy-peer-deps || ( find | |
| NODE_ENV="production" npm run build | ||
|
|
||
| %install | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui %{_builddir}/agama/dist/*.{gz,html,js,map,svg} | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui %{_builddir}/agama/dist/*.{css,gz,html,js,json,map,svg} | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui/fonts %{_builddir}/agama/dist/fonts/*.ttf | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui/assets/logos %{_builddir}/agama/src/assets/products/*.svg | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui/assets/logos %{_builddir}/agama/dist/assets/logos/*.svg | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NP: in the future we might want to go with a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, would be nice to unify this to have a single place for changes. |
||
|
|
||
| %files | ||
| %doc README.md | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| * Copyright (c) [2025] SUSE LLC | ||
| * | ||
| * All Rights Reserved. | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License as published by the Free | ||
| * Software Foundation; either version 2 of the License, or (at your option) | ||
| * any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| * more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License along | ||
| * with this program; if not, contact SUSE LLC. | ||
| * | ||
| * To contact SUSE LLC about this file by physical or electronic mail, you may | ||
| * find current contact information at www.suse.com. | ||
| */ | ||
|
|
||
| import agama from "~/agama"; | ||
|
|
||
| describe("agama", () => { | ||
| describe("formatList", () => { | ||
| afterEach(() => { | ||
| // restore the default language | ||
| agama.language = "en"; | ||
| }); | ||
|
|
||
| it("returns localized list", () => { | ||
| agama.language = "zh-CN"; | ||
| const list = agama.formatList(["1", "2", "3"], {}); | ||
| expect(list).toEqual("1、2和3"); | ||
| }); | ||
|
|
||
| it("it fallbacks to a simple formatting when the localized function fails", () => { | ||
| agama.language = "invalid:language"; | ||
| // disable the console logging in this test, a failure is expected so do | ||
| // not mess the output with a false alarm | ||
| jest.spyOn(console, "warn").mockImplementation(); | ||
| const list = agama.formatList(["1", "2", "3"], {}); | ||
| expect(list).toEqual("1, 2, 3"); | ||
| }); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.