Skip to content

Commit

Permalink
Merge pull request #12107 from bbc/chinese-trad-timestamp-updates
Browse files Browse the repository at this point in the history
Update Chinese trad timestamp object
  • Loading branch information
karinathomasbbc authored Oct 29, 2024
2 parents 9448ea6 + a9667d0 commit 275b924
Show file tree
Hide file tree
Showing 5 changed files with 469 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,12 @@
"exact date and time with timezone": "2019年7月12日下午12点55分"
},
"trad": {
"one minute ago": "1 分钟前",
"five minutes ago": "5 分钟前",
"one hour ago": "1 小时前",
"five hours ago": "5 小时前",
"one minute ago": "1 分鐘前",
"five minutes ago": "5 分鐘前",
"one hour ago": "1 小時前",
"five hours ago": "5 小時前",
"exact date": "2018年10月10日",
"exact date and time with timezone": "2019年7月12日下午12点55分"
"exact date and time with timezone": "2019年7月12日下午12時55分"
}
}
}
2 changes: 1 addition & 1 deletion src/app/legacy/containers/ArticleTimestamp/timeFormats.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 2019-03-22
export const formatDateNumeric = 'YYYY-MM-DD';

const longDatetimeLocales = ['ja', 'ko', 'zh-cn'];
const longDatetimeLocales = ['ja', 'ko', 'zh-cn', 'zh-tw'];

// 22 March 2019
export const formatDate = datetimeLocale => {
Expand Down
18 changes: 18 additions & 0 deletions src/app/legacy/psammead/psammead-locales/moment/zh-tw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const moment = require('moment');
require('moment/locale/zh-tw');

moment.updateLocale('zh-tw', {
longDateFormat: {
LL: 'YYYY年M月D日',
LLL: 'YYYY年M月D日Ah時mm分',
},
relativeTime: {
// these keys have been overridden with our translations
// some other keys have been left as set upstream
// see https://github.com/moment/moment/blob/develop/src/locale/zh-tw.js
m: '1 分鐘',
mm: '%d 分鐘',
h: '1 小時',
hh: '%d 小時',
},
});
Loading

0 comments on commit 275b924

Please sign in to comment.