Skip to content

Commit

Permalink
Suisin/chore: add Khmer language into deriv-app (#15714)
Browse files Browse the repository at this point in the history
* chore: add Khmer language into deriv-app

* chore: update deriv-com/translations package version

* Merge branch 'master' of github.com:binary-com/deriv-app into suisin/UPM1116/add_khmer_language

* chore: update km.json file

* chore: update quill-icons version and remove korean constant flag

* chore: update km.json file

* chore: add KM tag in initmoment so that time does not get translated

* chore: empty commit

* chore: update km.json files

* chore: remove comments for p2p i18next

* chore: fix bots toast notification issue

* chore: update khmer strings

* chore: strings to fix translation issue

* chore: update km.json strings

* chore: update km json strings

* fix: version

* fix: remove unused imports

---------

Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com>
  • Loading branch information
suisin-deriv and amina-deriv committed Jul 24, 2024
1 parent 9dfecda commit 649cd7b
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 29 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@binary-com/binary-document-uploader": "^2.4.8",
"@deriv-com/analytics": "1.10.0",
"@deriv-com/translations": "1.3.3",
"@deriv-com/translations": "1.3.4",
"@deriv-com/utils": "^0.0.25",
"@deriv-com/ui": "1.29.3",
"@deriv/api": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeEventHandler } from 'react';
import { Text, Icon } from '@deriv/components';
import { Text } from '@deriv/components';
import clsx from 'clsx';
import { TranslationFlag } from '@deriv/shared';

Expand Down Expand Up @@ -29,13 +29,7 @@ const LanguageRadioButton = ({ is_current_language, id, language_text, name, onC
className='settings-language__language--radio-button'
/>
<label htmlFor={id} className='settings-language__language--center-label'>
<div>
{TranslationFlag[id] ? (
TranslationFlag[id](36, 24)
) : (
<Icon icon={`IcFlag${id}`} className='settings-language__language-flag' />
)}
</div>
<div>{TranslationFlag[id](36, 24)}</div>
<div>
<Text
size='xs'
Expand Down
2 changes: 1 addition & 1 deletion packages/appstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"license": "Apache-2.0",
"dependencies": {
"@deriv-com/analytics": "1.10.0",
"@deriv-com/translations": "1.3.3",
"@deriv-com/translations": "1.3.4",
"@deriv/account": "^1.0.0",
"@deriv/cashier": "^1.0.0",
"@deriv/cfd": "^1.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/bot-skeleton/src/scratch/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ import './Binary/Trade Definition';
import './Logic';
import './Math';
import './Text';

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

&-body {
padding: 0;
height: 100%;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"dependencies": {
"@deriv-com/analytics": "1.10.0",
"@deriv-com/ui": "1.29.3",
"@deriv-com/translations": "1.3.3",
"@deriv-com/translations": "1.3.4",
"@deriv-com/utils": "^0.0.25",
"@deriv/account": "^1.0.0",
"@deriv/api": "^1.0.0",
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/components/src/components/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,6 @@ import './dxtrade/ic-dxtrade-financial-platform.svg';
import './dxtrade/ic-dxtrade-financial.svg';
import './dxtrade/ic-dxtrade-one-password.svg';
import './dxtrade/ic-dxtrade-synthetic-platform.svg';
import './flag/ic-flag-ko.svg';
import './mt5/ic-mt5-bvi-derived.svg';
import './mt5/ic-mt5-bvi-financial.svg';
import './mt5/ic-mt5-bvi-standard.svg';
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/components/types/icons.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type TIconsManifest = Readonly<{
contract: string;
currency: string;
dxtrade: string;
flag: string;
mt5: string;
option: string;
stock: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"@deriv-com/analytics": "1.10.0",
"@deriv-com/quill-tokens": "^2.0.4",
"@deriv-com/quill-ui": "1.13.17",
"@deriv-com/translations": "1.3.3",
"@deriv-com/translations": "1.3.4",
"@deriv-com/ui": "1.29.3",
"@deriv-com/utils": "^0.0.25",
"@deriv/account": "^1.0.0",
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/App/Components/Routes/language-link.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import classNames from 'classnames';
import { observer, useStore } from '@deriv/stores';
import { Icon } from '@deriv/components';
import { TranslationFlag, UNSUPPORTED_LANGUAGES } from '@deriv/shared';
import { getAllowedLanguages, useTranslations } from '@deriv-com/translations';

Expand All @@ -19,11 +18,7 @@ const LanguageLink = observer(({ is_clickable = false, lang, toggleModal }: TLan

const link: React.ReactNode = (
<React.Fragment>
{TranslationFlag[lang] ? (
TranslationFlag[lang](36, 24)
) : (
<Icon icon={`IcFlag${lang}`} className='settings-language__language-flag' />
)}
{TranslationFlag[lang](36, 24)}
<span
className={classNames('settings-language__language-name', {
'settings-language__language-name--active': is_active,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const languages = {
FR: 'Français',
ID: 'Indonesian',
IT: 'Italiano',
KM: 'ខ្មែរ',
KO: '한국어',
MN: 'Монгол',
PL: 'Polish',
Expand Down
2 changes: 2 additions & 0 deletions packages/p2p/src/components/i18next/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import de from 'Translations/de.json';
import fr from 'Translations/fr.json';
import id from 'Translations/id.json';
import it from 'Translations/it.json';
import km from 'Translations/km.json';
import ko from 'Translations/ko.json';
import mn from 'Translations/mn.json';
import pl from 'Translations/pl.json';
Expand Down Expand Up @@ -48,6 +49,7 @@ const i18n_config = {
FR: { translations: { ...fr } },
ID: { translations: { ...id } },
IT: { translations: { ...it } },
KM: { translations: { ...km } },
KO: { translations: { ...ko } },
MN: { translations: { ...mn } },
PL: { translations: { ...pl } },
Expand Down
5 changes: 4 additions & 1 deletion packages/shared/src/utils/constants/translation-flag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {
FlagArabLeagueIcon,
FlagBangladeshIcon,
FlagCambodiaIcon,
FlagChinaSimplifiedIcon,
FlagChinaTraditionalIcon,
FlagFranceIcon,
Expand All @@ -12,6 +13,7 @@ import {
FlagPolandIcon,
FlagPortugalIcon,
FlagRussiaIcon,
FlagSouthKoreaIcon,
FlagSpainIcon,
FlagSriLankaIcon,
FlagTanzaniaIcon,
Expand All @@ -30,7 +32,8 @@ const flagComponents = {
FR: FlagFranceIcon,
ID: FlagIndonesiaIcon,
IT: FlagItalyIcon,
// KO: ,
KM: FlagCambodiaIcon,
KO: FlagSouthKoreaIcon,
MN: FlagMongoliaIcon,
PL: FlagPolandIcon,
PT: FlagPortugalIcon,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/utils/date/date-time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type TExtendedMoment = typeof moment & {

// Localize moment instance with specific object
export const initMoment = (lang: string) => {
const hasEnMomentLocale = ['EN', 'AR', 'BN', 'SI']; // 'AR', 'BN' & 'SI' langs have non-numeric dates ('২০২৪-০৫-০৭'), our current usage of moment requires us to make all dates numeric
const hasEnMomentLocale = ['EN', 'AR', 'BN', 'SI', 'KM']; // 'AR', 'BN' & 'SI' langs have non-numeric dates ('২০২৪-০৫-০৭'), our current usage of moment requires us to make all dates numeric
if (!lang) return moment;
let locale = lang.toLowerCase().replace('_', '-');
if (hasEnMomentLocale.includes(lang)) locale = 'en-gb';
Expand Down
2 changes: 2 additions & 0 deletions packages/translations/src/i18next/i18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const ALL_LANGUAGES = Object.freeze({
FR: 'Français',
ID: 'Indonesian',
IT: 'Italiano',
KM: 'ខ្មែរ',
KO: '한국어',
MN: 'Монгол',
PL: 'Polish',
Expand All @@ -37,6 +38,7 @@ export const getAllowedLanguages = () => {
ES: 'Español',
BN: 'বাংলা',
DE: 'Deutsch',
KM: 'ខ្មែរ',
KO: '한국어',
MN: 'Монгол',
PT: 'Português',
Expand Down
2 changes: 1 addition & 1 deletion packages/translations/src/translations/km.json
Original file line number Diff line number Diff line change
Expand Up @@ -4269,4 +4269,4 @@
"-1254554534": "សូមប្ដូររយៈពេលតារាងទំហំទៅតារាងកសិករលើនិងការប្រើប្រាស់អ្វីទាំងអស់ច្បាស់ល្អជាង។",
"-1658230823": "កិច្ចប្រភេទបានលក់សម្រាប់ <0 />។",
"-1905867404": "កិច្ចប្បល់បង្ហាញបានបញ្ចប់"
}
}

0 comments on commit 649cd7b

Please sign in to comment.