Browse Source

replace 'en-US' with 'en_US'

Yuki Takei 5 years ago
parent
commit
90d4a4d940

+ 1 - 1
CHANGES.md

@@ -1357,7 +1357,7 @@ Upgrading Guide: <https://docs.growi.org/en/admin-guide/upgrading/34x.html>
 
 * Fix: The problem that path including round bracket makes something bad
 * Fix: Recursively option processes also unexpedted pages
-* Fix: en-US translation
+* Fix: en_US translation
 
 ## v2.0.7
 

+ 1 - 1
rs-i18n.env

@@ -1,7 +1,7 @@
 RS_I18N_BAIDU_APP_ID=
 RS_I18N_BAIDU_APP_SECRET=
 RS_I18N_LOCALES_DIR=./resource/locales
-RS_I18N_BASE_LANGUAGE=en-US
+RS_I18N_BASE_LANGUAGE=en_US
 RS_I18N_TARGET_FILE_SUFFIX= '.json'
 RS_I18N_DEBUG_FORMAT=__{%s}__
 

+ 2 - 2
src/client/js/components/InstallerForm.jsx

@@ -11,13 +11,13 @@ class InstallerForm extends React.Component {
 
     this.state = {
       isValidUserName: true,
-      checkedBtn: 'en-US',
+      checkedBtn: 'en_US',
     };
     this.checkUserName = this.checkUserName.bind(this);
   }
 
   componentWillMount() {
-    this.changeLanguage('en-US');
+    this.changeLanguage('en_US');
   }
 
   checkUserName(event) {

+ 1 - 1
src/client/js/services/PersonalContainer.js

@@ -24,7 +24,7 @@ export default class PersonalContainer extends Container {
       email: '',
       registrationWhiteList: this.appContainer.getConfig().registrationWhiteList,
       isEmailPublished: false,
-      lang: 'en-US',
+      lang: 'en_US',
       isGravatarEnabled: false,
       isUploadedPicture: false,
       uploadedPictureSrc: this.getUploadedPictureSrc(this.appContainer.currentUser),

+ 1 - 1
src/client/js/util/i18n.js

@@ -24,7 +24,7 @@ export default (userlang) => {
       resources,
       load: 'currentOnly',
 
-      fallbackLng: 'en-US',
+      fallbackLng: 'en_US',
       detection: {
         order: ['userSettingDetector', 'querystring', 'localStorage'],
       },

+ 1 - 1
src/server/models/config.js

@@ -38,7 +38,7 @@ module.exports = function(crowi) {
       'app:confidential'  : undefined,
 
       'app:fileUpload'    : false,
-      'app:globalLang'    : 'en-US',
+      'app:globalLang'    : 'en_US',
 
       'security:restrictGuestMode'      : 'Deny',
 

+ 2 - 2
src/server/models/user.js

@@ -23,7 +23,7 @@ module.exports = function(crowi) {
   const IMAGE_POPULATION = { path: 'imageAttachment', select: 'filePathProxied' };
 
   const LANG_EN = 'en';
-  const LANG_EN_US = 'en-US';
+  const LANG_EN_US = 'en_US';
   const LANG_EN_GB = 'en-GB';
   const LANG_JA = 'ja';
 
@@ -632,7 +632,7 @@ module.exports = function(crowi) {
         return mailer.send({
           to: user.email,
           subject: `Invitation to ${appTitle}`,
-          template: path.join(crowi.localeDir, 'en-US/admin/userInvitation.txt'),
+          template: path.join(crowi.localeDir, 'en_US/admin/userInvitation.txt'),
           vars: {
             email: user.email,
             password: user.password,

+ 1 - 1
src/server/routes/apiv3/users.js

@@ -37,7 +37,7 @@ const validator = {};
  *          lang:
  *            type: string
  *            description: language
- *            example: 'en-US'
+ *            example: 'en_US'
  *          status:
  *            type: integer
  *            description: status

+ 1 - 1
src/server/routes/installer.js

@@ -67,7 +67,7 @@ module.exports = function(crowi, app) {
     const username = registerForm.username;
     const email = registerForm.email;
     const password = registerForm.password;
-    const language = registerForm['app:globalLang'] || 'en-US';
+    const language = registerForm['app:globalLang'] || 'en_US';
 
     await appService.initDB(language);
 

+ 1 - 1
src/server/routes/login-passport.js

@@ -253,7 +253,7 @@ module.exports = function(crowi, app) {
     let name;
 
     switch (globalLang) {
-      case 'en-US':
+      case 'en_US':
         name = `${response.name.givenName} ${response.name.familyName}`;
         break;
       case 'ja':

+ 1 - 1
src/server/routes/login.js

@@ -161,7 +161,7 @@ module.exports = function(crowi, app) {
       return mailer.send({
         to: admin.email,
         subject: `[${appTitle}:admin] A New User Created and Waiting for Activation`,
-        template: path.join(crowi.localeDir, 'en-US/admin/userWaitingActivation.txt'),
+        template: path.join(crowi.localeDir, 'en_US/admin/userWaitingActivation.txt'),
         vars: {
           createdUser: userData,
           admin,

+ 1 - 1
src/server/routes/user.js

@@ -18,7 +18,7 @@
  *          lang:
  *            type: string
  *            description: language
- *            example: 'en-US'
+ *            example: 'en_US'
  *          status:
  *            type: integer
  *            description: status

+ 1 - 1
src/server/service/global-notification/index.js

@@ -9,7 +9,7 @@ class GlobalNotificationService {
 
   constructor(crowi) {
     this.crowi = crowi;
-    this.defaultLang = 'en-US'; // TODO: get defaultLang from app global config
+    this.defaultLang = 'en_US'; // TODO: get defaultLang from app global config
 
     this.gloabalNotificationMail = new GloabalNotificationMail(crowi);
     this.gloabalNotificationSlack = new GloabalNotificationSlack(crowi);