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

Commit

Permalink
added: Add Chinese regional text display content (#47)
Browse files Browse the repository at this point in the history
* added: Add Chinese regional text display content

* fix: change filename and val name
  • Loading branch information
huifer authored Dec 23, 2023
1 parent f1c2453 commit 69b9993
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
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: 6 additions & 2 deletions lib/export-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IControl, Map as MapboxMap } from 'mapbox-gl';
import CrosshairManager from './crosshair-manager';
import PrintableAreaManager from './printable-area-manager';
import {
english, finnish, french, german, swedish, Translation, vietnam,
english, finnish, french, german, swedish, Translation, vietnam, zhHans, zhHant
} from './local';
import MapGenerator, {
Size, Format, PageOrientation, DPI, Unit,
Expand All @@ -16,7 +16,7 @@ type Options = {
Crosshair?: boolean;
PrintableArea: boolean;
accessToken?: string;
Local?: 'de' | 'en' | 'fr' | 'fi' | 'sv' | 'vi';
Local?: 'de' | 'en' | 'fr' | 'fi' | 'sv' | 'vi' | 'zhHans' | 'zhHant';
}

/**
Expand Down Expand Up @@ -72,6 +72,10 @@ export default class MapboxExportControl implements IControl {
return swedish;
case 'vi':
return vietnam;
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 @@ -4,6 +4,8 @@ import finnish from './fi';
import german from './de';
import swedish from './sv';
import vietnam from './vi';
import zhHans from './zhHans';
import zhHant from './zhHant';

type Translation = {
PageSize: string;
Expand All @@ -20,5 +22,7 @@ export {
german,
swedish,
vietnam,
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 69b9993

Please sign in to comment.