Skip to content
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

AppImage is missing localization #1382

Closed
crsib opened this issue Jul 29, 2021 · 3 comments · Fixed by #1675
Closed

AppImage is missing localization #1382

crsib opened this issue Jul 29, 2021 · 3 comments · Fixed by #1675
Assignees
Labels
bug An error, undesired behaviour, or missed functionality P1 Highest level priority bugs (ship blocker / must fix)
Milestone

Comments

@crsib
Copy link
Member

crsib commented Jul 29, 2021

AppImage only contains English localization.

Expected behavior
AppImage is localized to all supported languages

@crsib crsib added bug An error, undesired behaviour, or missed functionality P1 Highest level priority bugs (ship blocker / must fix) Bug severity: High labels Jul 29, 2021
@petersampsonaudacity
Copy link

petersampsonaudacity commented Aug 1, 2021

See also this Forum post: audacity-wxgtk2 3.0.3 do not portuguese language
https://forum.audacityteam.org/viewtopic.php?f=48&t=119499

@SteveDaulton
Copy link
Member

SteveDaulton commented Aug 1, 2021

Workaround (previously posted here: https://forum.audacityteam.org/viewtopic.php?p=431498#p431498).

The audacity.cfg file may be manually edited (while Audacity is NOT running) to select the required language. For example, for French:

[Locale]
Language=fr

The Audacity 3.0.3 AppImage will then open with the selected language (in this case, French).

@AnitaBats AnitaBats added this to the Audacity 3.1 milestone Aug 19, 2021
@AnitaBats AnitaBats added this to To do in Sprint 5 - Release 3.1 via automation Aug 26, 2021
@AnitaBats AnitaBats moved this from To do to In progress in Sprint 5 - Release 3.1 Sep 6, 2021
shoogle added a commit to shoogle/audacity that referenced this issue Sep 14, 2021
shoogle added a commit to shoogle/audacity that referenced this issue Sep 15, 2021
The INSTALL_PREFIX variable in src/audacity_config.h.in was being
passed into the program as an empty string. The file is configured
in the top-level CMakeLists.txt but INSTALL_PREFIX is defined in
src/CMakeLists.txt. CMake variables are not passed to the parent scope
unless explicitly requested.

Partially fix audacity#1382. Allows Audacity to find the translations when they
are at the default location specified by INSTALL_PREFIX, but not if
they have been moved elsewhere. This works for distro builds but it's
not enough to get the AppImage working again.
shoogle added a commit to shoogle/audacity that referenced this issue Sep 15, 2021
Audacity and its resources (e.g. modules, translations, etc.) are
installed to fixed locations defined during configuration by the
CMake variable INSTALL_PREFIX.

  Executable:     INSTALL_PREFIX/bin/audacity
  Resources:      INSTALL_PREFIX/share/*

Typical values:

  INSTALL_PREFIX: /usr/local
  Executable:     /usr/local/bin/audacity
  Resources:      /usr/local/share/*

Previously, at runtime Audacity would check for resources at the
location specified by INSTALL_PREFIX. This worked fine as long as the
resources were never moved from that location, which is usually true
for distribution packages and self-compiled builds. However, if the
resources were ever moved from where CMake installed them then Audacity
would be unable to find them at runtime.

This is a problem for the AppImage, which self-mounts at a different
temporary location every time it is run, meaning that the resources are
in a different place each time, and never at the place specified in
INSTALL_PREFIX.

Typical values for the AppImage:

  INSTALL_PREFIX: /home/runner/work/audacity/audacity/build/install
  Executable:     /tmp/.mount_audaciXXXXXX/usr/bin/audacity
  Resources:      /tmp/.mount_audaciXXXXXX/usr/share/*

  (Where 'XXXXXX' is a different alphanumeric sequence on each run.)

To solve this, a PORTABLE_PREFIX is constructed at runtime by dropping
the final two components of the path to the exectuable.

  Executable:      /some/directory/bin/audacity
  PORTABLE_PREFIX: /some/directory          (dropped '/bin/audacity')
  Resources:       /some/directory/share/*

This enables Audacity to find the resources even if they are moved, as
long as the executable and resources are moved together (i.e. their
location relative to each other stays the same), which is the case with
the AppImage.

As a fallback in case the executable and resources become separated
(i.e. their location relative to each other changes) Audacity will
revert back to using the fixed location specified by INSTALL_PREFIX.

Fix audacity#1382.
@Paul-Licameli Paul-Licameli moved this from In progress to Review In Progress in Sprint 5 - Release 3.1 Sep 16, 2021
Sprint 5 - Release 3.1 automation moved this from Review In Progress to Ready for QA Sep 16, 2021
Paul-Licameli pushed a commit that referenced this issue Sep 16, 2021
The INSTALL_PREFIX variable in src/audacity_config.h.in was being
passed into the program as an empty string. The file is configured
in the top-level CMakeLists.txt but INSTALL_PREFIX is defined in
src/CMakeLists.txt. CMake variables are not passed to the parent scope
unless explicitly requested.

Partially fix #1382. Allows Audacity to find the translations when they
are at the default location specified by INSTALL_PREFIX, but not if
they have been moved elsewhere. This works for distro builds but it's
not enough to get the AppImage working again.
Paul-Licameli pushed a commit that referenced this issue Sep 16, 2021
Audacity and its resources (e.g. modules, translations, etc.) are
installed to fixed locations defined during configuration by the
CMake variable INSTALL_PREFIX.

  Executable:     INSTALL_PREFIX/bin/audacity
  Resources:      INSTALL_PREFIX/share/*

Typical values:

  INSTALL_PREFIX: /usr/local
  Executable:     /usr/local/bin/audacity
  Resources:      /usr/local/share/*

Previously, at runtime Audacity would check for resources at the
location specified by INSTALL_PREFIX. This worked fine as long as the
resources were never moved from that location, which is usually true
for distribution packages and self-compiled builds. However, if the
resources were ever moved from where CMake installed them then Audacity
would be unable to find them at runtime.

This is a problem for the AppImage, which self-mounts at a different
temporary location every time it is run, meaning that the resources are
in a different place each time, and never at the place specified in
INSTALL_PREFIX.

Typical values for the AppImage:

  INSTALL_PREFIX: /home/runner/work/audacity/audacity/build/install
  Executable:     /tmp/.mount_audaciXXXXXX/usr/bin/audacity
  Resources:      /tmp/.mount_audaciXXXXXX/usr/share/*

  (Where 'XXXXXX' is a different alphanumeric sequence on each run.)

To solve this, a PORTABLE_PREFIX is constructed at runtime by dropping
the final two components of the path to the exectuable.

  Executable:      /some/directory/bin/audacity
  PORTABLE_PREFIX: /some/directory          (dropped '/bin/audacity')
  Resources:       /some/directory/share/*

This enables Audacity to find the resources even if they are moved, as
long as the executable and resources are moved together (i.e. their
location relative to each other stays the same), which is the case with
the AppImage.

As a fallback in case the executable and resources become separated
(i.e. their location relative to each other changes) Audacity will
revert back to using the fixed location specified by INSTALL_PREFIX.

Fix #1382.
@Penikov Penikov moved this from Ready for QA to In QA in Sprint 5 - Release 3.1 Sep 16, 2021
@Penikov
Copy link
Contributor

Penikov commented Sep 17, 2021

Works fine.
изображение

@Penikov Penikov moved this from In QA to Done in Sprint 5 - Release 3.1 Sep 17, 2021
hugofloresgarcia pushed a commit to audacitorch/audacity that referenced this issue Oct 4, 2021
The INSTALL_PREFIX variable in src/audacity_config.h.in was being
passed into the program as an empty string. The file is configured
in the top-level CMakeLists.txt but INSTALL_PREFIX is defined in
src/CMakeLists.txt. CMake variables are not passed to the parent scope
unless explicitly requested.

Partially fix audacity#1382. Allows Audacity to find the translations when they
are at the default location specified by INSTALL_PREFIX, but not if
they have been moved elsewhere. This works for distro builds but it's
not enough to get the AppImage working again.
hugofloresgarcia pushed a commit to audacitorch/audacity that referenced this issue Oct 4, 2021
Audacity and its resources (e.g. modules, translations, etc.) are
installed to fixed locations defined during configuration by the
CMake variable INSTALL_PREFIX.

  Executable:     INSTALL_PREFIX/bin/audacity
  Resources:      INSTALL_PREFIX/share/*

Typical values:

  INSTALL_PREFIX: /usr/local
  Executable:     /usr/local/bin/audacity
  Resources:      /usr/local/share/*

Previously, at runtime Audacity would check for resources at the
location specified by INSTALL_PREFIX. This worked fine as long as the
resources were never moved from that location, which is usually true
for distribution packages and self-compiled builds. However, if the
resources were ever moved from where CMake installed them then Audacity
would be unable to find them at runtime.

This is a problem for the AppImage, which self-mounts at a different
temporary location every time it is run, meaning that the resources are
in a different place each time, and never at the place specified in
INSTALL_PREFIX.

Typical values for the AppImage:

  INSTALL_PREFIX: /home/runner/work/audacity/audacity/build/install
  Executable:     /tmp/.mount_audaciXXXXXX/usr/bin/audacity
  Resources:      /tmp/.mount_audaciXXXXXX/usr/share/*

  (Where 'XXXXXX' is a different alphanumeric sequence on each run.)

To solve this, a PORTABLE_PREFIX is constructed at runtime by dropping
the final two components of the path to the exectuable.

  Executable:      /some/directory/bin/audacity
  PORTABLE_PREFIX: /some/directory          (dropped '/bin/audacity')
  Resources:       /some/directory/share/*

This enables Audacity to find the resources even if they are moved, as
long as the executable and resources are moved together (i.e. their
location relative to each other stays the same), which is the case with
the AppImage.

As a fallback in case the executable and resources become separated
(i.e. their location relative to each other changes) Audacity will
revert back to using the fixed location specified by INSTALL_PREFIX.

Fix audacity#1382.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, undesired behaviour, or missed functionality P1 Highest level priority bugs (ship blocker / must fix)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants