This commit is contained in:
Danil Kovtonyuk 2022-04-22 13:05:56 +10:00
commit 44f31f8b9f
No known key found for this signature in database
GPG key ID: E72A919BF08C3746
402 changed files with 47865 additions and 0 deletions

View file

@ -0,0 +1,5 @@
import ru from './ru'
import uk from './uk'
import zh from './zh'
export const locales = [ru, uk, zh]

View file

@ -0,0 +1,53 @@
module.exports = {
languageTag: 'ru-RU',
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal() {
// not ideal, but since in Russian it can taken on
// different forms (masculine, feminine, neuter)
// this is all we can do
return '.'
},
currency: {
symbol: 'руб.',
position: 'postfix',
code: 'RUB'
},
currencyFormat: {
thousandSeparated: true,
totalLength: 4,
spaceSeparated: true,
average: true
},
formats: {
fourDigits: {
totalLength: 4,
spaceSeparated: true,
average: true
},
fullWithTwoDecimals: {
output: 'currency',
mantissa: 2,
spaceSeparated: true,
thousandSeparated: true
},
fullWithTwoDecimalsNoCurrency: {
mantissa: 2,
thousandSeparated: true
},
fullWithNoDecimals: {
output: 'currency',
spaceSeparated: true,
thousandSeparated: true,
mantissa: 0
}
}
}

View file

@ -0,0 +1,53 @@
module.exports = {
languageTag: 'uk-UA',
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal: () => {
// not ideal, but since in Ukrainian it can taken on
// different forms (masculine, feminine, neuter)
// this is all we can do
return ''
},
currency: {
symbol: '\u20B4',
position: 'postfix',
code: 'UAH'
},
currencyFormat: {
thousandSeparated: true,
totalLength: 4,
spaceSeparated: true,
average: true
},
formats: {
fourDigits: {
totalLength: 4,
spaceSeparated: true,
average: true
},
fullWithTwoDecimals: {
output: 'currency',
mantissa: 2,
spaceSeparated: true,
thousandSeparated: true
},
fullWithTwoDecimalsNoCurrency: {
mantissa: 2,
thousandSeparated: true
},
fullWithNoDecimals: {
output: 'currency',
spaceSeparated: true,
thousandSeparated: true,
mantissa: 0
}
}
}

View file

@ -0,0 +1,47 @@
module.exports = {
languageTag: 'zh-CN',
delimiters: {
thousands: ',',
decimal: '.'
},
abbreviations: {
thousand: '千',
million: '百万',
billion: '十亿',
trillion: '兆'
},
ordinal() {
return '.'
},
currency: {
symbol: '¥',
position: 'prefix',
code: 'CNY'
},
currencyFormat: {
thousandSeparated: true,
totalLength: 4,
spaceSeparated: true,
average: true
},
formats: {
fourDigits: {
totalLength: 4,
spaceSeparated: true,
average: true
},
fullWithTwoDecimals: {
thousandSeparated: true,
mantissa: 2
},
fullWithTwoDecimalsNoCurrency: {
mantissa: 2,
thousandSeparated: true
},
fullWithNoDecimals: {
output: 'currency',
thousandSeparated: true,
mantissa: 0
}
}
}

10
plugins/numbro/numbro.js Normal file
View file

@ -0,0 +1,10 @@
import numbro from 'numbro'
import { locales } from './languages'
export default (ctx, inject) => {
locales.forEach((lang) => {
numbro.registerLanguage(lang)
})
ctx.$numbro = numbro
inject('numbro', numbro)
}