Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tails
tails
Commits
0bb5e6bb
Commit
0bb5e6bb
authored
Oct 21, 2014
by
Tails developers
Browse files
Make language code extraction more robust.
There are three letter language codes, e.g. fur.
parent
27db6a6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/chroot_local-includes/usr/local/lib/tails-shell-library/localization.sh
View file @
0bb5e6bb
#!/bin/sh
language_code_from_locale
()
{
echo
"
${
1
}
"
|
sed
"s,
\(
_
\|\.\)
.*
$,
,"
}
localize_tails_doc_page
()
{
local
page
=
"
${
1
}
"
local
lang_code
=
"
$(
echo
${
LANG
}
|
head
-c
2
)
"
local
lang_code
=
"
$(
language_code_from_locale
"
${
LANG
}
"
)
"
local
try_page
for
locale
in
"
${
lang_code
}
"
"en"
;
do
try_page
=
"
${
page
}
.
${
locale
}
.html"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment