Skip to content

Commit

Permalink
Clean-up Japanese
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Mar 21, 2024
1 parent 587304a commit 9326244
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 859 deletions.
48 changes: 0 additions & 48 deletions src/locales/ja/datepicker.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
// 1. Specify output format
const format = 'YYYY/MM/DD';

// 2A. Either re-use settings and phrases from vue2-datepicker...
const locale = import('vue2-datepicker/locale/ja');

// 2B. ... or define your own based on https://github.com/mengxiong10/vue2-datepicker
/*
const locale = {
// the locale of formatting and parsing function
formatLocale: {
// MMMM
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
// MMM
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
// dddd
weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
// ddd
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
// dd
weekdaysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
// first day of week
firstDayOfWeek: 0,
// first week contains January 1st.
firstWeekContainsDate: 1,
// format 'a', 'A'
meridiem: (h: number, _: number, isLowercase: boolean) {
const word = h < 12 ? 'AM' : 'PM';
return isLowercase ? word.toLocaleLowerCase() : word;
},
// parse ampm
meridiemParse: /[ap]\.?m?\.?/i;
// parse ampm
isPM: (input: string) {
return `${input}`.toLowerCase().charAt(0) === 'p';
}
},
// the calendar header, default formatLocale.weekdaysMin
days: [],
// the calendar months, default formatLocale.monthsShort
months: [],
// the calendar title of year
yearFormat: 'YYYY',
// the calendar title of month
monthFormat: 'MMM',
// the calendar title of month before year
monthBeforeYear: false,
}
*/

export default {format, locale};
7 changes: 3 additions & 4 deletions src/locales/ja/default.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Utils from '../../utils';
export default Utils.mergeDeep(
// Don't import the fields.json as it's a 1:1 mapping anyway.
// If you want to make changes to en/fields.json you can override the phrases in custom.json
// (or alternatively you can remove the '//' from the next line and edit the field.json directly).
// { fields: require('./fields.json') },
{
fields: require('./fields.json')
},
require('./texts.json'),
require('./custom.json')
);
30 changes: 0 additions & 30 deletions src/locales/ja/duration.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,2 @@
// A. Either re-use phrases from iso-duration...
import { ja as locale } from '@musement/iso-duration';

// B. ... or define your own based on https://github.com/musement/iso-duration
/*
const locale = {
years(c) {
return "year" + (c === 1 ? "" : "s");
},
months(c) {
return "month" + (c === 1 ? "" : "s");
},
weeks(c) {
return "week" + (c === 1 ? "" : "s");
},
days(c) {
return "day" + (c === 1 ? "" : "s");
},
hours(c) {
return "hour" + (c === 1 ? "" : "s");
},
minutes(c) {
return "minute" + (c === 1 ? "" : "s");
},
seconds(c) {
return "second" + (c === 1 ? "" : "s");
},
decimal: ".",
};
*/

export default locale;
Loading

0 comments on commit 9326244

Please sign in to comment.