Murmele / Gittyup

Understand your Git history!
https://murmele.github.io/Gittyup
MIT License
1.37k stars 107 forks source link

Switching UI language in windows #653

Open plsnp opened 8 months ago

plsnp commented 8 months ago

How can i switch the language of the user interface in Windows? I could not find the option

Murmele commented 8 months ago

Hi,

can you try: https://murmele.github.io/Gittyup/ Multi language support

plsnp commented 8 months ago

How do i add that to the shortcut?

image

Would be nice to be able to switch language with the gittyup GUI

Murmele commented 8 months ago

Can you try to add LANG=de before "C:..." in Ziel:?

LiarOnce commented 8 months ago

It is recommended to provide toggle support directly in the settings, LANG= doesn't seem to be working in Linux. 2023-11-02_14-07

Murmele commented 8 months ago

For me it worked on Linux. Did you use the flatpak version?

LiarOnce commented 8 months ago

@Murmele No, I compiled it from source code.

EDIT: When I started with the compiled and used the Debug parameter(-d), l10n seemed to point to a confusing directory:

"Root dir: /usr/lib"
"App dir: /usr/lib/gittyup"
"Doc dir: /usr/lib/Gittyup"
"Conf dir: /usr/lib/Gittyup"
"l10n dir: /home/liaronce/Git/Gittyup/l10n" //What?
"dictionaries dir: /usr/lib/Gittyup/dictionaries"
"lexer dir: /usr/lib/Gittyup/lexers"
"themes dir: /usr/lib/Gittyup/themes"
"pluginsDir dir: /usr/lib/Gittyup/plugins"

When I compile translation to .qm file in this directory and it works fine. AND flatpak version:

"Root dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files"
"App dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/bin"
"Doc dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup"
"Conf dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup"
"l10n dir: /run/build/Gittyup/l10n"      //same issue
"dictionaries dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/dictionaries"
"lexer dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/lexers"
"themes dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/themes"
"pluginsDir dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/plugins"

And I think that due to the characteristics of EXT4, the case of the directory affects the directory judgment, locale files in gittyup(lower case): 图片

Murmele commented 8 months ago

@Murmele No, I compiled it from source code.

EDIT: When I started with the compiled and used the Debug parameter(-d), l10n seemed to point to a confusing directory:

"Root dir: /usr/lib"
"App dir: /usr/lib/gittyup"
"Doc dir: /usr/lib/Gittyup"
"Conf dir: /usr/lib/Gittyup"
"l10n dir: /home/liaronce/Git/Gittyup/l10n" //What?
"dictionaries dir: /usr/lib/Gittyup/dictionaries"
"lexer dir: /usr/lib/Gittyup/lexers"
"themes dir: /usr/lib/Gittyup/themes"
"pluginsDir dir: /usr/lib/Gittyup/plugins"

When I compile translation to .qm file in this directory and it works fine. AND flatpak version:

"Root dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files"
"App dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/bin"
"Doc dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup"
"Conf dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup"
"l10n dir: /run/build/Gittyup/l10n"      //same issue
"dictionaries dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/dictionaries"
"lexer dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/lexers"
"themes dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/themes"
"pluginsDir dir: /var/lib/flatpak/app/com.github.Murmele.Gittyup/x86_64/development/a4f8f7b02fbcde5fc35d0b5ef33dba7bdeb963e3ffc71b35817c82cf594b533c/files/share/Gittyup/plugins"

And I think that due to the characteristics of EXT4, the case of the directory affects the directory judgment, locale files in gittyup(lower case): 图片

That means during build the path was not set correctly image

image

foreach(QM_FILE ${QT_QM_FILES})
  if(EXISTS ${QM_FILE})
    install(
      FILES ${QM_FILE}
      DESTINATION ${L10N_INSTALL_DIR}
      COMPONENT ${GITTYUP_NAME})
  endif()
endforeach()

foreach(QM_FILE ${QM_FILES})
  install(
    FILES ${QM_FILE}
    DESTINATION ${L10N_INSTALL_DIR}
    COMPONENT ${GITTYUP_NAME})
endforeach()

Seems they don't get installed

image

Murmele commented 8 months ago

I create a MR to test if it helps to enable updating the translations: https://github.com/Murmele/Gittyup/pull/657

LiarOnce commented 8 months ago

Oh there's a problem with my work, I'm using the compilation arguments I got from the AUR PKGBUILD so that there is a problem like this

cmake -G Ninja .. -Wno-dev \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_INSTALL_PREFIX=/usr/lib/gittyup \
    -DCMAKE_INSTALL_DATADIR=/usr/lib \
    -DCMAKE_INSTALL_BINDIR=/usr/lib/gittyup \
    -DENABLE_REPRODUCIBLE_BUILDS=ON \
    -DENABLE_UPDATE_OVER_GUI=OFF \
    -DGENERATE_APPDATA=ON \
    -DBUILD_SHARED_LIBS=OFF \
    -DUSE_SYSTEM_CMARK=ON \
    -DUSE_SYSTEM_GIT=ON \
    -DUSE_SYSTEM_HUNSPELL=ON \
    -DUSE_SYSTEM_LIBSSH2=ON \
    -DUSE_SYSTEM_LUA=ON \
    -DUSE_SYSTEM_OPENSSL=ON \
    -DUSE_SYSTEM_QT=ON

EDIT: works fine with these arguments:

cmake -G Ninja .. -Wno-dev \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_REPRODUCIBLE_BUILDS=ON \
    -DENABLE_UPDATE_OVER_GUI=OFF \
    -DGENERATE_APPDATA=ON \
    -DBUILD_SHARED_LIBS=OFF \
    -DUSE_SYSTEM_CMARK=ON \
    -DUSE_SYSTEM_GIT=ON \
    -DUSE_SYSTEM_HUNSPELL=ON \
    -DUSE_SYSTEM_LIBSSH2=ON \
    -DUSE_SYSTEM_LUA=ON \
    -DUSE_SYSTEM_OPENSSL=ON \
    -DUSE_SYSTEM_QT=ON \
    -DUPDATE_TRANSLATIONS=ON
Murmele commented 8 months ago

Can you try with the following artifacts again? They are from the PR mentioned above https://github.com/Murmele/Gittyup/actions/runs/6738762975?pr=657

LiarOnce commented 8 months ago

Yes, I tried it and the results are still the same.

Murmele commented 8 months ago

Ah for the flatpak package it is not implemented. There I have to add it to flathub manifest. I will give it a try