Skip to content

Commit

Permalink
feat: add fr-FR locale (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai authored Nov 27, 2024
1 parent 3f85188 commit 69c980e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe('export-virtual-locales-module', () => {
'node_modules/@univerjs/ui/lib/es/locale/en-US.js': '/* en-US locale */',
'node_modules/@univerjs/ui/lib/es/locale/zh-CN.js': '/* zh-CN locale */',
'node_modules/@univerjs/ui/lib/es/locale/ru-RU.js': '/* ru-RU locale */',
'node_modules/@univerjs/ui/lib/locale/ru-RU.json': '/* ru-RU locale */',
'node_modules/@univerjs/design/lib/locale/vi-VN.json': '/* vi-VN locale */',

'node_modules/@univerjs/design/lib/index.css': '/* univerjs design css */',
Expand All @@ -36,5 +35,6 @@ describe('export-virtual-locales-module', () => {
expect(outputCode).toMatch(/export const enUS = _Tools.deepMerge\([a-zA-Z]{8}enUS,\n\);/)
expect(outputCode).toMatch(/export const ruRU = _Tools.deepMerge\([a-zA-Z]{8}ruRU,\n\);/)
expect(outputCode).toMatch(/export const zhCN = _Tools.deepMerge\([a-zA-Z]{8}zhCN,\n\);/)
expect(outputCode).toMatch(/export const viVN = _Tools.deepMerge\([a-zA-Z]{8}viVN,\n\);/)
})
})
2 changes: 1 addition & 1 deletion packages/core/src/export-virtual-locales-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const virtualLocalesModuleId = 'univer:locales'
export function exportVirtualLocalesModule() {
const scopes = ['@univerjs', '@univerjs-pro']

const languages = ['en-US', 'ru-RU', 'zh-CN', 'vi-VN', 'zh-TW', 'fa-IR'].reduce((acc, lang) => {
const languages = ['en-US', 'ru-RU', 'zh-CN', 'vi-VN', 'zh-TW', 'fa-IR', 'fr-FR'].reduce((acc, lang) => {
acc[lang] = new Set()
return acc
}, {})
Expand Down
3 changes: 2 additions & 1 deletion packages/esbuild-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The plugin provides a virtual module `univer:locales`, which simplifies the impo
```typescript
import { LocaleType } from '@univerjs/core'

import { enUS, faIR, ruRU, viVN, zhCN, zhTW } from 'univer:locales'
import { enUS, faIR, frFR, ruRU, viVN, zhCN, zhTW } from 'univer:locales'

new Univer({
locales: {
Expand All @@ -54,6 +54,7 @@ new Univer({
[LocaleType.VI_VN]: viVN,
[LocaleType.ZH_TW]: zhTW,
[LocaleType.FA_IR]: faIR,
[LocaleType.FR_FR]: frFR,
}
})
```
Expand Down
1 change: 1 addition & 0 deletions packages/esbuild-plugin/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ declare module 'univer:locales' {
export const viVN: { [key: string]: string }
export const zhTW: { [key: string]: string }
export const faIR: { [key: string]: string }
export const frFR: { [key: string]: string }
}
3 changes: 2 additions & 1 deletion packages/vite-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The plugin provides a virtual module `univer:locales`, which simplifies the impo
```typescript
import { LocaleType } from '@univerjs/core'

import { enUS, faIR, ruRU, viVN, zhCN, zhTW } from 'univer:locales'
import { enUS, faIR, frFR, ruRU, viVN, zhCN, zhTW } from 'univer:locales'

new Univer({
locales: {
Expand All @@ -54,6 +54,7 @@ new Univer({
[LocaleType.VI_VN]: viVN,
[LocaleType.ZH_TW]: zhTW,
[LocaleType.FA_IR]: faIR,
[LocaleType.FR_FR]: frFR,
}
})
```
Expand Down
1 change: 1 addition & 0 deletions packages/vite-plugin/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ declare module 'univer:locales' {
export const viVN: { [key: string]: string }
export const zhTW: { [key: string]: string }
export const faIR: { [key: string]: string }
export const frFR: { [key: string]: string }
}
3 changes: 2 additions & 1 deletion packages/webpack-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The plugin provides a virtual module `univer:locales`, which simplifies the impo
```typescript
import { LocaleType } from '@univerjs/core'

import { enUS, faIR, ruRU, viVN, zhCN, zhTW } from 'univer:locales'
import { enUS, faIR, frFR, ruRU, viVN, zhCN, zhTW } from 'univer:locales'

new Univer({
locales: {
Expand All @@ -53,6 +53,7 @@ new Univer({
[LocaleType.VI_VN]: viVN,
[LocaleType.ZH_TW]: zhTW,
[LocaleType.FA_IR]: faIR,
[LocaleType.FR_FR]: frFR,
}
})
```
Expand Down
1 change: 1 addition & 0 deletions packages/webpack-plugin/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ declare module 'univer:locales' {
export const viVN: { [key: string]: string }
export const zhTW: { [key: string]: string }
export const faIR: { [key: string]: string }
export const frFR: { [key: string]: string }
}
55 changes: 23 additions & 32 deletions pnpm-lock.yaml

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

0 comments on commit 69c980e

Please sign in to comment.