Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change language/texts #37

Closed
sagits opened this issue Apr 20, 2015 · 9 comments
Closed

How to change language/texts #37

sagits opened this issue Apr 20, 2015 · 9 comments

Comments

@sagits
Copy link

sagits commented Apr 20, 2015

Very nice library, heres how to change texts (usefull for changing language):

public class MyImagePickerActivity extends ImagePickerActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);



    getActionBar().getTabAt(0).setText("Camera");
    getActionBar().getTabAt(1).setText("Gallery");

    ((Button)findViewById(R.id.action_btn_cancel)).setText("Cancel");
    ((Button)findViewById(R.id.action_btn_done)).setText("Done");
    ((TextView)findViewById(R.id.selected_photos_empty)).setText("No image selected");

  }
}

By the way, can you declare all ImagePickerActivity fields protected? Whis way we can extend it and change for our needs.

@jaydeepw
Copy link
Owner

Okay, thanks for commenting and helping the fellow users. I will create the issue to change member field visibility.

@sagits
Copy link
Author

sagits commented Apr 22, 2015

Thank you. I Would like to be able to change the "images already selected" text, when i select a language. I have tried to import your lib as a module (so i can change it), but not been able. Can you set this text as a variable too please? Thanks in advance.

@jaydeepw
Copy link
Owner

if you want to add a language, please add appropriate string.xml file in a newly created directory and send me PR, I will merge. Read more about localization on android. Let me know if you need any help.

@tomoyuki28jp
Copy link

Japanese translations here:

<string name="done">完了</string>
<string name="cancel">キャンセル</string>
<string name="take_photo">カメラ</string>
<string name="gallery">写真</string>
<string name="progress_title">写真を保存中...</string>
<string name="no_images_selected">選択中の写真はありません</string>
<string name="imageview_content_description">アルバムの写真</string>
<string name="imageview_capture_photo_content_description">写真を撮る</string>
<string name="n_images_selected">写真は%1$s枚までしか選択できません</string>
<string name="photo_save_error_toast">写真を保存できません</string>

If you want me to create a pull request, please let me know which directory and file name I should add these translations to.

@jaydeepw
Copy link
Owner

@tomoyuki28jp Thanks for the translation. Please google and find out the identifier for strings.xml file in values directory. I think it will be something like /res/values-jp/strings.xml but I am not sure. Please search and find and put these translations in appropriate location and send a PR. Let me know if I can help.

@tomoyuki28jp
Copy link

@jaydeepw Thanks for your reply. Yeah, as you said, the directory name seems 'values-ja'. I'll create a pull request then.

@jaydeepw
Copy link
Owner

@tomoyuki28jp Please submit a PR on develop branch.

@tomoyuki28jp
Copy link

Please submit a PR on develop branch.

@jaydeepw Oh, okay! Thanks for letting me know that in advance :)

@jaydeepw
Copy link
Owner

Converted methods to protected so as to enable overriding when extending from ImagePickerActivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants