-
Create Folder
+ {this.props.t('NewFolderModal.Title')}
@@ -32,23 +34,24 @@ class NewFolderModal extends React.Component {
}
NewFolderModal.propTypes = {
- closeModal: PropTypes.func.isRequired
+ closeModal: PropTypes.func.isRequired,
+ t: PropTypes.func.isRequired
};
function validate(formProps) {
const errors = {};
if (!formProps.name) {
- errors.name = 'Please enter a name';
+ errors.name = i18n.t('NewFolderModal.EnterName');
} else if (formProps.name.trim().length === 0) {
- errors.name = 'Folder name cannot contain only spaces';
+ errors.name = i18n.t('NewFolderModal.EmptyName');
} else if (formProps.name.match(/\.+/i)) {
- errors.name = 'Folder name cannot contain an extension';
+ errors.name = i18n.t('NewFolderModal.InvalidExtension');
}
return errors;
}
-export default reduxForm({
+export default withTranslation()(reduxForm({
form: 'new-folder',
fields: ['name'],
validate
-})(NewFolderModal);
+})(NewFolderModal));
diff --git a/translations/locales/en-US/translations.json b/translations/locales/en-US/translations.json
index 56a898f5..d0868580 100644
--- a/translations/locales/en-US/translations.json
+++ b/translations/locales/en-US/translations.json
@@ -173,5 +173,26 @@
},
"IDEView": {
"SubmitFeedback": "Submit Feedback"
+ },
+ "NewFileModal": {
+ "Title": "Create File",
+ "CloseButtonARIA": "Close New File Modal",
+ "EnterName": "Please enter a name",
+ "InvalidType": "Invalid file type. Valid extensions are .js, .css, .json, .txt, .csv, .tsv, .frag, and .vert."
+ },
+ "NewFileForm": {
+ "AddFileSubmit": "Add File",
+ "Placeholder": "Name"
+},
+ "NewFolderModal": {
+ "Title": "Create Folder",
+ "CloseButtonARIA": "Close New Folder Modal",
+ "EnterName": "Please enter a name",
+ "EmptyName": "Folder name cannot contain only spaces",
+ "InvalidExtension": "Folder name cannot contain an extension"
+ },
+ "NewFolderForm": {
+ "AddFolderSubmit": "Add Folder",
+ "Placeholder": "Name"
}
}
diff --git a/translations/locales/es-419/translations.json b/translations/locales/es-419/translations.json
index 8b8d8f87..398da8dc 100644
--- a/translations/locales/es-419/translations.json
+++ b/translations/locales/es-419/translations.json
@@ -172,6 +172,27 @@
},
"IDEView": {
"SubmitFeedback": "Enviar retroalimentación"
+ },
+ "NewFileModal": {
+ "Title": "Crear Archivo",
+ "CloseButtonARIA": "Cerrar diálogo de crear archivo",
+ "EnterName": "Por favor introduce un nombre",
+ "InvalidType": "Tipo de archivo inválido. Las extensiones válidas son .js, .css, .json, .txt, .csv, .tsv, .frag y .vert."
+ },
+ "NewFileForm": {
+ "AddFileSubmit": "Agregar Archivo",
+ "Placeholder": "Nombre"
+ },
+ "NewFolderModal": {
+ "Title": "Crear Directorio",
+ "CloseButtonARIA": "Cerrar Diálogo de Nuevo Directorio",
+ "EnterName": "Por favor introduce un nombre",
+ "EmptyName": " El nombre del directorio no debe contener solo espacios vacíos",
+ "InvalidExtension": "El nombre del directorio no debe contener una extensión"
+},
+ "NewFolderForm": {
+ "AddFolderSubmit": "Agregar Directorio",
+ "Placeholder": "Nombre"
}
}