v1.6.0 多语言支持。
This commit is contained in:
12
__tests__/I18n.test.js
Normal file
12
__tests__/I18n.test.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
const {Lunar, I18n} = require('../lunar');
|
||||||
|
|
||||||
|
test('test1', () => {
|
||||||
|
const lunar = Lunar.fromYmd(2023,1,1);
|
||||||
|
console.log(lunar.toFullString());
|
||||||
|
|
||||||
|
I18n.setLanguage('en');
|
||||||
|
console.log(lunar.toFullString());
|
||||||
|
|
||||||
|
I18n.setLanguage('chs');
|
||||||
|
});
|
||||||
|
|
||||||
5
index.js
5
index.js
@@ -1,4 +1,4 @@
|
|||||||
const {Solar, Lunar, Foto, Tao, NineStar, EightChar, SolarWeek, SolarMonth, SolarSeason, SolarHalfYear, SolarYear, LunarMonth, LunarYear, LunarTime, ShouXingUtil, SolarUtil, LunarUtil, FotoUtil, TaoUtil, HolidayUtil} = require('./lunar.js')
|
const {Solar, Lunar, Foto, Tao, NineStar, EightChar, SolarWeek, SolarMonth, SolarSeason, SolarHalfYear, SolarYear, LunarMonth, LunarYear, LunarTime, ShouXingUtil, SolarUtil, LunarUtil, FotoUtil, TaoUtil, HolidayUtil, I18n} = require('./lunar.js')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Solar: Solar,
|
Solar: Solar,
|
||||||
@@ -20,5 +20,6 @@ module.exports = {
|
|||||||
LunarUtil: LunarUtil,
|
LunarUtil: LunarUtil,
|
||||||
FotoUtil: FotoUtil,
|
FotoUtil: FotoUtil,
|
||||||
TaoUtil: TaoUtil,
|
TaoUtil: TaoUtil,
|
||||||
HolidayUtil: HolidayUtil
|
HolidayUtil: HolidayUtil,
|
||||||
|
I18n: I18n
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lunar-javascript",
|
"name": "lunar-javascript",
|
||||||
"version": "1.3.4",
|
"version": "1.6.0",
|
||||||
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
|
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user