Bug 439300 - Translation of tags and resources only happen when creating the database
Summary: Translation of tags and resources only happen when creating the database
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Translation (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
: 440949 (view as bug list)
Depends on:
Blocks: 439760
  Show dependency treegraph
 
Reported: 2021-06-29 13:00 UTC by Tiar
Modified: 2021-12-15 12:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2021-06-29 13:00:31 UTC
SUMMARY
Translated resource names and translated tags are pulled from the database, which means they are only translated to the language that was used when creating the database.


STEPS TO REPRODUCE
1. Remove the database
2. Open Krita in one language, see that tags match the old language
3. Switch Krita to another language and reopen it

OBSERVED RESULT
Tags and translated resource names are still in the old language.

EXPECTED RESULT
Tags and translated resource names should be in the new language.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git c75e336)
 Languages: pl, pl, pl, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.4.0-58-generic
  Pretty Productname: Linux Mint 20.1
  Product Type: linuxmint
  Product Version: 20.1
  Desktop: X-Cinnamon
Comment 1 Alvin Wong 2021-08-14 08:31:18 UTC
*** Bug 440949 has been marked as a duplicate of this bug. ***
Comment 2 Halla Rempt 2021-11-29 12:18:55 UTC
Note: we do not translate resource names at the moment.
Comment 3 Bug Janitor Service 2021-12-13 14:33:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1227
Comment 4 Halla Rempt 2021-12-15 12:35:09 UTC
Git commit 4a9a54ffef7f5cbedfd53eb322852889c96a2fa5 by Halla Rempt.
Committed on 15/12/2021 at 11:39.
Pushed by rempt into branch 'master'.

Make tags dynamically translatable

This adds a new table to the db scheme, removes the kconfig* backend
for reading ini files in favour of a hand-coded parser which can give
us all translated texts and handles getting the translated texts in
the tag model.

Note that this completely breaks saving tags from older database
schema's, so good thing we're still in beta.

M  +7    -11   libs/brush/KisAbrStorage.cpp
M  +0    -5    libs/global/kis_debug.cpp
M  +0    -3    libs/global/kis_debug.h
M  +2    -7    libs/image/KisAslStorage.cpp
M  +0    -4    libs/resources/CMakeLists.txt
M  +0    -6    libs/resources/KisBundleStorage.cpp
M  +0    -5    libs/resources/KisFolderStorage.cpp
M  +0    -6    libs/resources/KisMemoryStorage.cpp
M  +66   -25   libs/resources/KisResourceCacheDb.cpp
M  +1    -1    libs/resources/KisResourceCacheDb.h
M  +117  -63   libs/resources/KisResourceLocator.cpp
M  +8    -0    libs/resources/KisResourceLocator.h
M  +2    -13   libs/resources/KisResourceModel.cpp
M  +0    -12   libs/resources/KisResourceStorage.h
M  +124  -59   libs/resources/KisTag.cpp
M  +20   -13   libs/resources/KisTag.h
M  +57   -73   libs/resources/KisTagModel.cpp
M  +4    -14   libs/resources/KisTagResourceModel.cpp
D  +0    -202  libs/resources/bufferfragment_p.h
D  +0    -69   libs/resources/kconfigbackend.cpp
D  +0    -192  libs/resources/kconfigbackend_p.h
D  +0    -320  libs/resources/kconfigdata.cpp
D  +0    -231  libs/resources/kconfigdata.h
D  +0    -810  libs/resources/kconfigini.cpp
D  +0    -78   libs/resources/kconfigini_p.h
M  +1    -4    libs/resources/sql.qrc
A  +9    -0    libs/resources/sql/create_tag_translations.sql
M  +2    -2    libs/resources/sql/create_tags.sql
M  +1    -1    libs/resources/tests/TestFolderStorage.cpp

https://invent.kde.org/graphics/krita/commit/4a9a54ffef7f5cbedfd53eb322852889c96a2fa5
Comment 5 Halla Rempt 2021-12-15 12:58:36 UTC
Git commit 8504f5764fefcfe34534b4a784a3af50828c43c3 by Halla Rempt.
Committed on 15/12/2021 at 12:58.
Pushed by rempt into branch 'krita/5.0'.

Make tags dynamically translatable

This adds a new table to the db scheme, removes the kconfig* backend
for reading ini files in favour of a hand-coded parser which can give
us all translated texts and handles getting the translated texts in
the tag model.

Note that this completely breaks saving tags from older database
schema's, so good thing we're still in beta.
(cherry picked from commit 4a9a54ffef7f5cbedfd53eb322852889c96a2fa5)

M  +7    -11   libs/brush/KisAbrStorage.cpp
M  +0    -5    libs/global/kis_debug.cpp
M  +0    -3    libs/global/kis_debug.h
M  +2    -7    libs/image/KisAslStorage.cpp
M  +0    -4    libs/resources/CMakeLists.txt
M  +0    -6    libs/resources/KisBundleStorage.cpp
M  +0    -5    libs/resources/KisFolderStorage.cpp
M  +0    -6    libs/resources/KisMemoryStorage.cpp
M  +66   -25   libs/resources/KisResourceCacheDb.cpp
M  +1    -1    libs/resources/KisResourceCacheDb.h
M  +117  -63   libs/resources/KisResourceLocator.cpp
M  +8    -0    libs/resources/KisResourceLocator.h
M  +2    -13   libs/resources/KisResourceModel.cpp
M  +0    -12   libs/resources/KisResourceStorage.h
M  +124  -59   libs/resources/KisTag.cpp
M  +20   -13   libs/resources/KisTag.h
M  +57   -73   libs/resources/KisTagModel.cpp
M  +4    -14   libs/resources/KisTagResourceModel.cpp
D  +0    -202  libs/resources/bufferfragment_p.h
D  +0    -69   libs/resources/kconfigbackend.cpp
D  +0    -192  libs/resources/kconfigbackend_p.h
D  +0    -320  libs/resources/kconfigdata.cpp
D  +0    -231  libs/resources/kconfigdata.h
D  +0    -810  libs/resources/kconfigini.cpp
D  +0    -78   libs/resources/kconfigini_p.h
M  +1    -4    libs/resources/sql.qrc
A  +9    -0    libs/resources/sql/create_tag_translations.sql
M  +2    -2    libs/resources/sql/create_tags.sql
M  +1    -1    libs/resources/tests/TestFolderStorage.cpp

https://invent.kde.org/graphics/krita/commit/8504f5764fefcfe34534b4a784a3af50828c43c3