MastodonLanguage util side done

This commit is contained in:
LucasGGamerM 2022-12-14 20:15:29 -03:00
parent 4cbb59850b
commit 5d87fb7b67
1 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import android.content.res.Resources;
import android.os.Build;
import android.os.LocaleList;
import org.joinmastodon.android.GlobalUserPreferences;
import org.joinmastodon.android.model.Instance;
import java.util.ArrayList;
@ -94,8 +95,11 @@ public class MastodonLanguage {
}
public MastodonLanguage getDefault(String accountID) {
if(GlobalUserPreferences.defaultLanguages.get(accountID)==null){
GlobalUserPreferences.defaultLanguages.put(accountID, Locale.getDefault().getLanguage());
return from(Locale.getDefault().getLanguage());
}
return from(GlobalUserPreferences.defaultLanguages.get(accountID));
}
}
}