Skip to content

Commit

Permalink
Disable language support for prod due to low coverage of translations
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsaturn committed Apr 21, 2024
1 parent 2ef6d28 commit 71c211b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"typescript.referencesCodeLens.enabled": true,
"tslint.ignoreDefinitionFiles": false,
Expand Down
25 changes: 14 additions & 11 deletions src/containers/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { LockOutlined } from '@ant-design/icons'
import { Button, Card, Collapse, Input, Radio, Row, Layout, Select } from 'antd'
import { Button, Card, Collapse, Input, Layout, Radio, Row, Select } from 'antd'
import React, { ReactComponentElement } from 'react'
import { Redirect, RouteComponentProps } from 'react-router'
import ApiManager from '../api/ApiManager'
import ErrorFactory from '../utils/ErrorFactory'
import {
currentLanguageOption,
isLanguageEnabled,
languagesOptions,
localize,
} from '../utils/Language'
Expand Down Expand Up @@ -81,16 +82,18 @@ export default class Login extends ApiComponent<RouteComponentProps<any>, any> {
)}
style={{ width: 380 }}
extra={
<Select
options={languagesOptions}
value={currentLanguageOption.value}
onChange={(value) => {
StorageHelper.setLanguageInLocalStorage(
value
)
window.location.reload()
}}
/>
isLanguageEnabled ? (
<Select
options={languagesOptions}
value={currentLanguageOption.value}
onChange={(value) => {
StorageHelper.setLanguageInLocalStorage(
value
)
window.location.reload()
}}
/>
) : undefined
}
>
<NormalLoginForm
Expand Down
5 changes: 4 additions & 1 deletion src/containers/apps/CreateNewApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ class CreateNewApp extends Component<
})
}
>
Has Persistent Data
{localize(
'create_new_app.has_persistent_data',
'Has Persistent Data'
)}{' '}
</Checkbox>
&nbsp;&nbsp;
<Tooltip
Expand Down
3 changes: 3 additions & 0 deletions src/utils/Language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ export function localize(key: string, message: string) {
}

export { currentLanguageOption, languagesOptions }

// Currently only enable language for dev mode, until the vast majority of the content is translated
export const isLanguageEnabled = !!process.env.REACT_APP_IS_DEBUG

0 comments on commit 71c211b

Please sign in to comment.