Project

General

Profile

Actions

Bug #13776

closed

Some functions fail if the Language does not exactly match an available Locale

Added by Jim Pingle almost 2 years ago. Updated 11 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Translations
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.09
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

Some languages are defined in the pfSense translations system without a location, such as French which is defined as "fr". The problem is that certain functions expect to be able to load a locale using the same name. However, there are not always matches for these exactly as we specify them.

The easiest one to check if it works or not is Diagnostics > System Activity (diag_system_activity.php) or run top from Diagnostics > Command Prompt (diag_command.php).

Looking in /usr/share/locale on a dev snapshot there are several variations of French:

/usr/share/locale/fr_BE.UTF-8
/usr/share/locale/fr_CA.UTF-8
/usr/share/locale/fr_CH.UTF-8
/usr/share/locale/fr_FR.UTF-8

We should likely be setting the language as "fr_FR" in this case for example.

Languages we specify fully matching, such as en_US or pt_BR work as-is.

Some we have a location on but it doesn't match a locale (e.g. some of the variations of Chinese) and those maybe harder to fix.

So we either need to change the language names in the backend to match equivalent locale definitions or separately set the lang and locale to appropriate values.

If we change the names in the backend we will need upgrade code to ensure the user is moved to the new name on upgrade.


Related issues

Related to Bug #14414: Diagnostics activité system (French language setup) don't work: Unable to gather system activity (1). The command top -aSH give invalid locale.Duplicate

Actions
Actions #1

Updated by Jim Pingle almost 2 years ago

  • Description updated (diff)
Actions #2

Updated by Jim Pingle almost 2 years ago

Not a release blocker, can be pushed to 23.05 if we can't find a good solution near term.

Actions #3

Updated by Jim Pingle almost 2 years ago

  • Plus Target Version changed from 23.01 to 23.05
Actions #4

Updated by Jim Pingle over 1 year ago

  • Plus Target Version changed from 23.05 to 23.09
Actions #5

Updated by Marcos M over 1 year ago

  • Related to Bug #14414: Diagnostics activité system (French language setup) don't work: Unable to gather system activity (1). The command top -aSH give invalid locale. added
Actions #6

Updated by Marcos M over 1 year ago

Actions #7

Updated by Jim Pingle over 1 year ago

  • Target version changed from 2.7.0 to CE-Next
Actions #8

Updated by Jim Pingle about 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Jim Pingle
  • Target version changed from CE-Next to 2.8.0

It looks like the easiest path forward is to rename our translation directories and the internal IDs to match the base system locales that exist.

For example, rename them as follows in the filesystem under /usr/local/share/locale/ (and Zanata?):

"nl" => "nl_NL" 
"fr" => "fr_FR" 
"it" => "it_IT" 
"ko" => "ko_KR" 
"nb" => "nb_NO" 
"pl" => "pl_PL" 
"ru" => "ru_RU" 
"es" => "es_ES" 

Then make the same changes to the language list in source:src/etc/inc/pfSense-utils.inc#L3185

And finally, create an upgrade code function to change the old language names to the new language names.

Actions #9

Updated by Jim Pingle about 1 year ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #10

Updated by Jim Pingle about 1 year ago

  • Status changed from Feedback to Resolved

Works as expected on snapshots

Actions #11

Updated by Jim Pingle 11 months ago

  • Target version changed from 2.8.0 to 2.7.1
Actions

Also available in: Atom PDF