Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ Thumbs.db
.secrets/
libraries/plugins/src/plugins.ts
i18n.cache

.cursorignore
7 changes: 7 additions & 0 deletions apps/frontend/src/components/layout/language.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const getCountryCodeForFlag = (languageCode: string) => {
if (languageCode === 'en') return 'GB';
if (languageCode === 'es') return 'ES';
if (languageCode === 'ar') return 'SA';
if (languageCode === 'ckb') return 'KU';
if (languageCode === 'kmr') return 'KU';
if (languageCode === 'zh') return 'CN';
if (languageCode === 'he') return 'IL';
if (languageCode === 'ja') return 'JP';
Expand Down Expand Up @@ -76,6 +78,9 @@ export const ChangeLanguageComponent = () => {
// Function to get language name in its native script
const getLanguageName = useCallback((code: string) => {
try {
if (code === 'ckb') return 'سۆرانی';
if (code == 'kmr') return 'Kurmancî';

// Use browser's Intl API to get language name in native script
const displayNames = new Intl.DisplayNames([code], {
type: 'language',
Expand All @@ -101,6 +106,7 @@ export const ChangeLanguageComponent = () => {
>
<ReactCountryFlag
countryCode={getCountryCodeForFlag(language)}
cdnUrl="https://ocdn.soma.krd/flags/4x3/"
svg
style={{
width: '1.5em',
Expand Down Expand Up @@ -135,6 +141,7 @@ export const LanguageComponent = () => {
>
<ReactCountryFlag
countryCode={getCountryCodeForFlag(currentLanguage)}
cdnUrl="https://ocdn.soma.krd/flags/1x1/"
svg
style={{
width: '22px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ export const languages = [
'de',
'it',
'ja',
'kmr',
'ko',
'ar',
'ckb',
'tr',
'vi',
];
Expand Down
Loading