fix locale loading on Android

This commit is contained in:
tildearrow 2024-06-19 13:53:14 -05:00
parent 64f931e895
commit b779668bf8

View file

@ -597,6 +597,9 @@ int main(int argc, char** argv) {
bool textDomainBound=false; bool textDomainBound=false;
for (int i=0; localeDirs[i]; i++) { for (int i=0; localeDirs[i]; i++) {
#ifdef ANDROID
strncpy(localeDir,localeDirs[i],4095);
#else
if (exePath[0]!=0 && localeDirs[i][0]!=DIR_SEPARATOR) { if (exePath[0]!=0 && localeDirs[i][0]!=DIR_SEPARATOR) {
strncpy(localeDir,exePath,4095); strncpy(localeDir,exePath,4095);
strncat(localeDir,DIR_SEPARATOR_STR,4095); strncat(localeDir,DIR_SEPARATOR_STR,4095);
@ -604,8 +607,11 @@ int main(int argc, char** argv) {
} else { } else {
strncpy(localeDir,localeDirs[i],4095); strncpy(localeDir,localeDirs[i],4095);
} }
#endif
logV("bind text domain: %s",localeDir); logV("bind text domain: %s",localeDir);
#ifndef ANDROID
if (!dirExists(localeDir)) continue; if (!dirExists(localeDir)) continue;
#endif
if ((localeRet=TA_BINDTEXTDOMAIN("furnace",localeDir))==NULL) { if ((localeRet=TA_BINDTEXTDOMAIN("furnace",localeDir))==NULL) {
continue; continue;
} else { } else {