Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into feature/Add_ukraine_local
Browse files Browse the repository at this point in the history
  • Loading branch information
JinIgarashi authored Dec 23, 2023
2 parents 974260f + 69b9993 commit bd4cc26
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ You can specify default option as follows.
- `fr` french
- `fi` finnish
- `sv` swedish
- `zhHans` Chinese Simplified
- `zhHant` Chinese Traditional
## Attribution

When you use exported map, please includes attribution as follows.
Expand Down
8 changes: 7 additions & 1 deletion lib/export-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
Translation,
vietnam,
ukranian,
zhHans,
zhHant
} from './local';
import MapGenerator, {
Size,
Expand All @@ -27,7 +29,7 @@ type Options = {
Crosshair?: boolean;
PrintableArea: boolean;
accessToken?: string;
Local?: 'de' | 'en' | 'fr' | 'fi' | 'sv' | 'vi' | 'uk';
Local?: 'de' | 'en' | 'fr' | 'fi' | 'sv' | 'vi' | 'uk' | 'zhHans' | 'zhHant';
};

/**
Expand Down Expand Up @@ -85,6 +87,10 @@ export default class MapboxExportControl implements IControl {
return vietnam;
case 'uk':
return ukranian;
case 'zhHans':
return zhHans;
case 'zhHant':
return zhHant;
default:
return english;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/local/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import german from './de';
import swedish from './sv';
import vietnam from './vi';
import ukranian from './uk';
import zhHans from './zhHans';
import zhHant from './zhHant';

type Translation = {
PageSize: string;
Expand All @@ -22,5 +24,7 @@ export {
swedish,
vietnam,
ukranian,
zhHans,
zhHant,
Translation,
};
9 changes: 9 additions & 0 deletions lib/local/zhHans.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const translation = {
PageSize: '页面大小',
PageOrientation: '页面方向',
Format: '格式',
DPI: '像素',
Generate: '导出',
};

export default translation;
9 changes: 9 additions & 0 deletions lib/local/zhHant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const translation = {
PageSize: '頁面大小',
PageOrientation: '頁面方向',
Format: '格式',
DPI: '像素',
Generate: '導出',
};

export default translation;

0 comments on commit bd4cc26

Please sign in to comment.