Skip to main content

Localization

Every user-visible string in the editor UI can be overridden at runtime via the languages prop — no native rebuild required.

Basic usage​

Pass a partial ImageEditorLanguage object. Only the keys you provide are replaced; the rest fall back to English.

import { ImageEditor } from '@phucprime/react-native-image-editor';

ImageEditor.open({
path: imagePath,
languages: {
doneTitle: 'Finish',
saveTitle: 'Save to Gallery',
clearAllTitle: 'Remove All',
eraserTitle: 'Eraser',
},
onDone: (path) => {},
onCancel: () => {},
});

All overridable strings​

KeyDefault (English)Description
doneTitleDoneMain toolbar button — saves the edit in place
saveTitleSaveSave-to-gallery button (Android only)
clearAllTitleClear allRemoves all drawing/text/sticker layers
cameraTitleCameraCamera option label in sticker image picker
galleryTitleGalleryGallery option label in sticker image picker
uploadDialogTitleUpload ImageTitle of the sticker-source dialog
uploadPickerTitleSelect PictureTitle of the sticker source picker sheet
directoryCreateFailFailed to create directoryError message when storage dir creation fails
accessMediaPermissionsMsgTo attach photos, we need to access media on your devicePermission rationale dialog body
continueTxtContinuePermission rationale — confirm button label
notNowNOT NOWPermission rationale — dismiss button label
mediaAccessDeniedMsgYou denied storage access, no photos will be added.Toast shown when media access is denied
saveImageSucceedImage savedToast shown after successful save to gallery
eraserTitleEraserEraser tool button label

Full example — Vietnamese​

import type { ImageEditorLanguage } from '@phucprime/react-native-image-editor';

const VI: ImageEditorLanguage = {
doneTitle: 'Xong',
saveTitle: 'Lưu',
clearAllTitle: 'Xoá tất cả',
cameraTitle: 'Máy ảnh',
galleryTitle: 'Thư viện',
uploadDialogTitle: 'Tải ảnh lên',
uploadPickerTitle: 'Chọn ảnh',
directoryCreateFail: 'Không thể tạo thư mục',
accessMediaPermissionsMsg: 'Chúng tôi cần quyền truy cập ảnh để đính kèm',
continueTxt: 'Tiếp tục',
notNow: 'KHÔNG PHẢI LÚC NÀY',
mediaAccessDeniedMsg: 'Bạn đã từ chối quyền truy cập, không thể thêm ảnh.',
saveImageSucceed: 'Đã lưu ảnh',
eraserTitle: 'Tẩy',
};

ImageEditor.open({
path: imagePath,
languages: VI,
onDone: (path) => {},
onCancel: () => {},
});

Using with i18next / react-i18next​

import { useTranslation } from 'react-i18next';
import type { ImageEditorLanguage } from '@phucprime/react-native-image-editor';

function useEditorLanguages(): ImageEditorLanguage {
const { t } = useTranslation('editor');
return {
doneTitle: t('done'),
saveTitle: t('save'),
clearAllTitle: t('clearAll'),
eraserTitle: t('eraser'),
// ... other keys
};
}

// In your component:
const languages = useEditorLanguages();
ImageEditor.open({ path, languages, onDone, onCancel });

iOS note​

Language support on iOS is partially available. The languages prop is accepted and forwarded to the native layer. The TranslationService wiring in iOSPhotoEditor is planned for a future release; until then, the iOS editor displays English UI regardless of languages.

Android supports all keys fully through TranslationService.