From 69beed026908861feb9eb4b648e3d537fe666a91 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 13 Apr 2019 22:55:18 -0400 Subject: _try_load_locale(): Move before use --- (limited to 'src') diff --git a/src/locale.sh b/src/locale.sh index 1437bb8..7ec9359 100644 --- a/src/locale.sh +++ b/src/locale.sh @@ -22,6 +22,24 @@ DEFAULT_LOCALE='en_US' +_try_load_locale() +{ + local localedir="${1}" + local locale="${2}" + shift 2 + local ms= + + for ms in "${localedir}/${locale}/LC_MESSAGES/${TEXTDOMAIN}.ms" \ + "${localedir}/${locale}.ms"; do + if [ -f "${ms}" ]; then + . "${ms}" + return 0 + fi + done + + return 1 +} + load_locale() { local localedir= @@ -68,21 +86,3 @@ get_msg() return 0 } - -_try_load_locale() -{ - local localedir="${1}" - local locale="${2}" - shift 2 - local ms= - - for ms in "${localedir}/${locale}/LC_MESSAGES/${TEXTDOMAIN}.ms" \ - "${localedir}/${locale}.ms"; do - if [ -f "${ms}" ]; then - . "${ms}" - return 0 - fi - done - - return 1 -} -- cgit v0.9.1