1

I have a classic multi-language setup in my app with two 'values' folders: values for default danish language and values-se for swedish. My device is set to locale sw-SE, but my app still shows string resources in danish (default). If I move the danish resources to a folder values-da (for danish) and create an empty folder values, Then I get the error that the resource is not found. I this case if finds nither danish nor swedish strings.

Here is a typical call to a resource:

m_ButtonOk.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        String email = m_EditEmail.getText().toString();
        String pass = m_EditPassword.getText().toString();

        if (email.equals("") == false && pass.equals("") == false) {
            //Save user info to Crashlytics
            Crashlytics.setUserEmail(email);

            showProgressDialog(getResources().getString(R.string.wait), getResources().getString(R.string.logging_on));

            Intent logOnIntent = new Intent(v.getContext(), dk.le34.taskassistant.activity.TaskAssistantService.class);
            logOnIntent.addCategory("dk.le34.taskassistant.LOG_ON");
            logOnIntent.putExtra("EMAIL", email);
            logOnIntent.putExtra("PASSWORD", pass);
            logOnIntent.putExtra("REMEMBER", m_CheckBoxRemember.isChecked());
            startService(logOnIntent);
        } else {
            Toast.makeText(v.getContext(), getResources().getString(R.string.user_details), Toast.LENGTH_LONG).show();
        }

    }
});

My setup is by the book, so why do I get these errors?

5
  • It seems your locale doesn't match values-se. Check again. Commented Apr 28, 2015 at 17:29
  • I changed the locale to sw-SE. I could see in the logcat that this has been done correctly, and the device language is in swedish all arround. Tried it on a Genymotion emulator and the result is the same. Any ideas? Commented Apr 28, 2015 at 17:37
  • possible duplicate of Android, Language files not work Commented Apr 28, 2015 at 17:38
  • a little research before posting a question please. Commented Apr 28, 2015 at 17:39
  • 1
    Excuse my rudeness, but i did that, and I didn't find this duplicate. If you don't want to help, stay off the thread! Commented Apr 28, 2015 at 18:18

1 Answer 1

1

The locale for Swedish is "sv_SE". Your Swedish resources need to go into values-sv, not values-se.

"sv" is the language (in this case Swedish) "SE" is the country (in this case Sweden)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.