@nextcloud/l10n
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -35,2 +35,38 @@ /** | ||
export declare function translatePlural(app: string, textSingular: string, textPlural: string, count: Number, vars?: object, options?: TranslationOptions): string; | ||
/** | ||
* Get the first day of the week | ||
* | ||
* @return {number} | ||
*/ | ||
export declare function getFirstDay(): Number; | ||
/** | ||
* Get a list of day names (full names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export declare function getDayNames(): String[]; | ||
/** | ||
* Get a list of day names (short names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export declare function getDayNamesShort(): String[]; | ||
/** | ||
* Get a list of day names (minified names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export declare function getDayNamesMin(): String[]; | ||
/** | ||
* Get a list of month names (full names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export declare function getMonthNames(): String[]; | ||
/** | ||
* Get a list of month names (short names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export declare function getMonthNamesShort(): String[]; | ||
export {}; |
@@ -10,2 +10,8 @@ "use strict"; | ||
exports.translatePlural = translatePlural; | ||
exports.getFirstDay = getFirstDay; | ||
exports.getDayNames = getDayNames; | ||
exports.getDayNamesShort = getDayNamesShort; | ||
exports.getDayNamesMin = getDayNamesMin; | ||
exports.getMonthNames = getMonthNames; | ||
exports.getMonthNamesShort = getMonthNamesShort; | ||
@@ -78,2 +84,92 @@ /// <reference types="@nextcloud/typings" /> | ||
} | ||
/** | ||
* Get the first day of the week | ||
* | ||
* @return {number} | ||
*/ | ||
function getFirstDay() { | ||
if (typeof window.firstDay === 'undefined') { | ||
console.warn('No firstDay found'); | ||
return 1; | ||
} | ||
return window.firstDay; | ||
} | ||
/** | ||
* Get a list of day names (full names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
function getDayNames() { | ||
if (typeof window.dayNames === 'undefined') { | ||
console.warn('No dayNames found'); | ||
return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; | ||
} | ||
return window.dayNames; | ||
} | ||
/** | ||
* Get a list of day names (short names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
function getDayNamesShort() { | ||
if (typeof window.dayNamesShort === 'undefined') { | ||
console.warn('No dayNamesShort found'); | ||
return ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.']; | ||
} | ||
return window.dayNamesShort; | ||
} | ||
/** | ||
* Get a list of day names (minified names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
function getDayNamesMin() { | ||
if (typeof window.dayNamesMin === 'undefined') { | ||
console.warn('No dayNamesMin found'); | ||
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']; | ||
} | ||
return window.dayNamesMin; | ||
} | ||
/** | ||
* Get a list of month names (full names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
function getMonthNames() { | ||
if (typeof window.monthNames === 'undefined') { | ||
console.warn('No monthNames found'); | ||
return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; | ||
} | ||
return window.monthNames; | ||
} | ||
/** | ||
* Get a list of month names (short names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
function getMonthNamesShort() { | ||
if (typeof window.monthNamesShort === 'undefined') { | ||
console.warn('No monthNamesShort found'); | ||
return ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.']; | ||
} | ||
return window.monthNamesShort; | ||
} | ||
//# sourceMappingURL=index.js.map |
/// <reference types="@nextcloud/typings" /> | ||
type OC16to17 = Nextcloud.v16.OC | Nextcloud.v17.OC | ||
declare var OC: OC16to17; | ||
declare var OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC; | ||
declare var window: Nextcloud.v16.WindowWithGlobals | Nextcloud.v17.WindowWithGlobals | Nextcloud.v18.WindowWithGlobals; | ||
@@ -73,1 +73,85 @@ /** | ||
} | ||
/** | ||
* Get the first day of the week | ||
* | ||
* @return {number} | ||
*/ | ||
export function getFirstDay(): Number { | ||
if (typeof window.firstDay === 'undefined') { | ||
console.warn('No firstDay found') | ||
return 1 | ||
} | ||
return window.firstDay | ||
} | ||
/** | ||
* Get a list of day names (full names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export function getDayNames(): String[] { | ||
if (typeof window.dayNames === 'undefined') { | ||
console.warn('No dayNames found') | ||
return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] | ||
} | ||
return window.dayNames | ||
} | ||
/** | ||
* Get a list of day names (short names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export function getDayNamesShort(): String[] { | ||
if (typeof window.dayNamesShort === 'undefined') { | ||
console.warn('No dayNamesShort found') | ||
return ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'] | ||
} | ||
return window.dayNamesShort | ||
} | ||
/** | ||
* Get a list of day names (minified names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export function getDayNamesMin(): String[] { | ||
if (typeof window.dayNamesMin === 'undefined') { | ||
console.warn('No dayNamesMin found') | ||
return ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] | ||
} | ||
return window.dayNamesMin | ||
} | ||
/** | ||
* Get a list of month names (full names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export function getMonthNames(): String[] { | ||
if (typeof window.monthNames === 'undefined') { | ||
console.warn('No monthNames found') | ||
return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | ||
} | ||
return window.monthNames | ||
} | ||
/** | ||
* Get a list of month names (short names) | ||
* | ||
* @return {String[]} | ||
*/ | ||
export function getMonthNamesShort(): String[] { | ||
if (typeof window.monthNamesShort === 'undefined') { | ||
console.warn('No monthNamesShort found') | ||
return ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'] | ||
} | ||
return window.monthNamesShort | ||
} |
{ | ||
"name": "@nextcloud/l10n", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "", | ||
@@ -11,3 +11,4 @@ "main": "dist/index.js", | ||
"dev": "babel ./lib --out-dir dist --extensions '.ts,.tsx' --watch", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest", | ||
"test:watch": "jest --watchAll" | ||
}, | ||
@@ -25,12 +26,14 @@ "keywords": [ | ||
"dependencies": { | ||
"core-js": "3.1.4" | ||
"core-js": "3.2.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "7.4.4", | ||
"@babel/core": "7.4.5", | ||
"@babel/preset-env": "7.4.5", | ||
"@babel/preset-typescript": "7.3.3", | ||
"@nextcloud/typings": "^0.1.1", | ||
"@babel/cli": "7.6.3", | ||
"@babel/core": "7.6.3", | ||
"@babel/preset-env": "7.6.3", | ||
"@babel/preset-typescript": "7.6.0", | ||
"@nextcloud/typings": "^0.1.3", | ||
"babel-jest": "^24.9.0", | ||
"browserslist-config-nextcloud": "0.0.1", | ||
"typescript": "3.5.2" | ||
"jest": "^24.9.0", | ||
"typescript": "3.6.3" | ||
}, | ||
@@ -37,0 +40,0 @@ "browserslist": [ |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
55433
11
397
1
9
+ Addedcore-js@3.2.1(transitive)
- Removedcore-js@3.1.4(transitive)
Updatedcore-js@3.2.1