Closed leagris closed 7 years ago
%LANGUAGE%
will always fall back to en_us
if the page is not found in the currently selected language.
@Vexatos I had issue with en_us
≠ en_US
on Linux/MacOS Systems. It look like paths in config are not affected by lowercased resource names.
A Fall-back language en_us
you changed in commit, will not find files in en_US
directory with Linux/MacOS systems. And an en_US
locale will not find files stored in en_us
…
The locale is always called en_us
since Minecraft 1.11. There is no en_US
anymore.
@Vexatos
Config file paths are not lowercased in 1.11.2.
the locale environment variable returns en_US
mixed casing, because this is what is configured in options.txt
lang:en_US
So, I think you may be wrong here:
We had %LANGUAGE%/index.md
not loaded on linux because file path was
config/rtfm/en_us/changelogs/index.md
https://github.com/Beyond-Reality/Beyond-Realty-Farscapes/blob/8977626f922a16b1aff4f4c20dc95f42fba07347/config/rtfm/en_us/changelogs/index.md
as configured in https://github.com/Beyond-Reality/Beyond-Realty-Farscapes/blob/8977626f922a16b1aff4f4c20dc95f42fba07347/config/rtfm.cfg#L43-L49
changelogs {
S:tabIcon=minecraft:paper@0
I:tabIconMode=1
S:tabName=tooltip.rtfm.manual.tab2
S:tabPath=%LANGUAGE%/changelogs/index.md
}
When concatenating this locale to file path, it searched here for:
config/rtfm/en_US/changelogs/index.md
(because lang:en_US
inoptions.txt
)
whereas the dir name was:
config/rtfm/en_us/changelogs/index.md
So, if you set:
private static final String FALLBACK_LANGUAGE = "en_us";
On one side, users with lang:en_US
will have files searched in config/rtfm/en_US
Whereas users with lang:en_GB
into options.txt
with FALLBACK_LANGUAGE = "en_us"
will have files searched in config/rtfm/en_us
This will break on OS differentiating path/file casing.
So, to avoid confusion and issues with OS path casing, and be safe when MC/Forges decides to lowercase config files as well. Just lowercase the Language string. It will work everywhere and with future implementations.
I am not quite sure what your issue is. I am using Linux myself and everything works exactly as expected, no matter which language I select.
options.txt
should definitely not have lang:en_US
but lang:en_us
, and it does for me. Not sure what you are doing wrong.
Dear, go get a break before re-reading :)
Your commit did not address initial issue:
%LANGUAGE%/index.md
file you can not configure/change path in config.But you broke it with https://github.com/Vexatos/RTFM/commit/d5b81ec3c151e388eec2a2d05a8f679e963e88c7 because now, users on fall-back will not access same files paths.
You claim it isn't working, but I cannot reproduce that. It works for me every single test regardless of the language I select. Changing mainTab
to change the page it opens on first use works too.
When first opening manual, no Tab is selected and, path in
rtfm.cfg
is ignored. It then tries to load a static default path%LANGUAGE%/index.md
that is not part of configuration forgeneral
section.If
%LANGUAGE%
relative path does not exists; it can not find the index. It happens only when first opening the documentation after login-in, because no Tab has been selected. Once user selects a Tab, proper paths are those configured for selected Tab.Incentive to not use
%LANGUAGE%
in path is: to have a consistent default documentation available and working, even if user selected Language is noten_US
, likeen_GB
orfr_FR
.I suggest you could add an option for a fall-back locale name like this: