fix: return empty if the key-value is empty value

PR-URL: https://github.com/koajs/locales/pull/17
Reviewed-By: fengmk2 <fengmk2@gmail.com>
Reviewed-By: dead-horse <heyiyu.deadhorse@gmail.com>
This commit is contained in:
ermin.zem
2015-12-22 15:02:45 +08:00
committed by fengmk2
parent e4679a486d
commit c45be8b6ea
4 changed files with 24 additions and 4 deletions

View File

@@ -36,6 +36,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -76,6 +77,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -101,6 +103,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -125,6 +128,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -150,6 +154,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -174,6 +179,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -201,6 +207,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -232,6 +239,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -255,6 +263,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -278,6 +287,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -303,6 +313,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -328,6 +339,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -355,6 +367,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: '',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -382,6 +395,7 @@ describe('koa-locales.test.js', function () {
empty: '',
notexists_key: 'key not exists',
empty_string: '',
empty_value: 'emptyValue',
novalue: 'key %s ok',
arguments3: '1 2 3',
arguments4: '1 2 3 4',
@@ -423,6 +437,7 @@ function createApp(options) {
empty: this[fname](),
notexists_key: this[fname]('key not exists'),
empty_string: this[fname](''),
empty_value: this[fname]('emptyValue'),
novalue: this[fname]('key %s ok'),
arguments3: this[fname]('%s %s %s', 1, 2, 3),
arguments4: this[fname]('%s %s %s %s', 1, 2, 3, 4),
@@ -435,3 +450,4 @@ function createApp(options) {
return app;
}