-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(i18n): modularize and shard by feature (#7134)
* refactor(i18n): move locale files to specific directories Prepare for sharding up of locale resources by moving each locale into its own directory. Use this as the base to manage future growth and expansion of locale resources to cover most text in FormSG. No code change. * refactor(i18n): add features dir, shard login locale Hold feature-specific locale resources in a `features/` dir for each locale, to minimise clutter even as we add more text to hold as resources. * refactor(i18n): reorg translations by feature, not locale
- Loading branch information
Showing
6 changed files
with
55 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
import { enSG as login } from './features/login' | ||
import Translation from './types' | ||
|
||
export const enSG: Translation = { | ||
translation: { | ||
features: { | ||
login: { | ||
LoginPage: { | ||
slogan: 'Build secure government forms in minutes', | ||
}, | ||
components: { | ||
LoginForm: { | ||
onlyAvailableForPublicOfficers: | ||
'Log in with a .gov.sg or other whitelisted email address', | ||
emailEmptyErrorMsg: 'Please enter an email address', | ||
login: 'Log in', | ||
haveAQuestion: 'Have a question?', | ||
}, | ||
}, | ||
}, | ||
login, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Login } from '.' | ||
|
||
export const enSG: Login = { | ||
LoginPage: { | ||
slogan: 'Build secure government forms in minutes', | ||
}, | ||
components: { | ||
LoginForm: { | ||
onlyAvailableForPublicOfficers: | ||
'Log in with a .gov.sg or other whitelisted email address', | ||
emailEmptyErrorMsg: 'Please enter an email address', | ||
login: 'Log in', | ||
haveAQuestion: 'Have a question?', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export * from './en-sg' | ||
export * from './zh-sg' | ||
|
||
export interface Login { | ||
components: { | ||
LoginForm: { | ||
onlyAvailableForPublicOfficers: string | ||
emailEmptyErrorMsg: string | ||
login: string | ||
haveAQuestion: string | ||
} | ||
} | ||
LoginPage: { | ||
slogan: string | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Login } from '.' | ||
|
||
export const zhSG: Login = { | ||
LoginPage: { | ||
slogan: '在几分钟内创建安全的政府表格', | ||
}, | ||
components: { | ||
LoginForm: { | ||
onlyAvailableForPublicOfficers: | ||
'只供拥有 gov.sg 或其他列入白名单的电子邮件的公职人员使用', | ||
emailEmptyErrorMsg: '请输入电子邮件地址', | ||
login: '登录', | ||
haveAQuestion: '有问题?', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
import { zhSG as login } from './features/login' | ||
import Translation from './types' | ||
|
||
export const zhSG: Translation = { | ||
translation: { | ||
features: { | ||
login: { | ||
LoginPage: { | ||
slogan: '在几分钟内创建安全的政府表格', | ||
}, | ||
components: { | ||
LoginForm: { | ||
onlyAvailableForPublicOfficers: | ||
'只供拥有 gov.sg 或其他列入白名单的电子邮件的公职人员使用', | ||
emailEmptyErrorMsg: '请输入电子邮件地址', | ||
login: '登录', | ||
haveAQuestion: '有问题?', | ||
}, | ||
}, | ||
}, | ||
login, | ||
}, | ||
}, | ||
} |