Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ App.getLocales = function() {
};


/**
* @return {string} default locale
*/
App.getDefaultUILocale = function() {
return App.DEFAULT_LOCALE;
};


/**
* @return {string} browser locale
*/
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/multipleshapeshelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,8 @@ thin.core.MultipleShapesHelper.prototype.createPropertyComponent_ = function() {

var baseFormatInputProperty = new thin.ui.PropertyPane.InputProperty(thin.t('field_basic_format'));
var baseFormatInput = baseFormatInputProperty.getValueControl();
baseFormatInput.setTooltip(thin.t('text_placeholder_of_base_format_description'));

baseFormatInputProperty.addEventListener(propEventType.CHANGE, function(e) {

var formatBase = e.target.getValue();
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/tblockshape.js
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,8 @@ thin.core.TblockShape.prototype.createPropertyComponent_ = function() {

var baseFormatInputProperty = new thin.ui.PropertyPane.InputProperty(thin.t('field_basic_format'));
var baseFormatInput = baseFormatInputProperty.getValueControl();
baseFormatInput.setTooltip(thin.t('text_placeholder_of_base_format_description'));

baseFormatInputProperty.addEventListener(propEventType.CHANGE,
function(e) {

Expand Down
37 changes: 36 additions & 1 deletion src/app/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ thin.i18n.currentLocaleId_;
thin.i18n.translations_;


/**
* @type {Object}
* @private
*/
thin.i18n.defaultLocale_;


/**
* @type {Object}
* @private
*/
thin.i18n.defaultTranslations_;


/**
* @param {string} name
* @param {Object=} opt_values
Expand All @@ -49,7 +63,9 @@ thin.i18n.translations_;
thin.i18n.translate = function(name, opt_values) {
var i18n = thin.i18n;
var msg = i18n.makeMessage_(
i18n.getMessages()[name], opt_values) || '';
i18n.getMessages()[name] ||
i18n.getDefaultMessages()[name], opt_values) || '';

return goog.string.newLineToBr(goog.string.htmlEscape(msg));
};

Expand Down Expand Up @@ -91,6 +107,19 @@ thin.i18n.getMessages = function() {
};


/**
* @return {Object}
*/
thin.i18n.getDefaultMessages = function() {
var i18n = thin.i18n;

if (!i18n.defaultTranslations_) {
i18n.defaultTranslations_ = /** @type {Object} */(i18n.defaultLocale_['messages']);
}
return i18n.defaultTranslations_;
};


/**
* @return {string}
*/
Expand Down Expand Up @@ -133,6 +162,12 @@ thin.i18n.init = function() {

i18n.currentLocaleId_ = localeId;
i18n.currentLocale_ = locale;

var defaultLocaleId = thin.callApp('getDefaultUILocale');
i18n.defaultLocaleId_ = defaultLocaleId;
i18n.defaultLocale_ = goog.array.find(locales, function(loc) {
return loc.id == defaultLocaleId;
});
};


Expand Down
1 change: 1 addition & 0 deletions src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ App.addLocale({
text_apply_locale_setting: 'After reloading the Editor, the setting will be applied.\nDo you want to apply now?',
text_layout_force_edit_confirmation: 'Because this layout has been created with a newer version, there is a risk of some configurations are broken by editing.\nAre you sure you want to edit anyway?',
text_placeholder_of_pageno_description: '[Available Placeholders] {page}:Page Number, {total}:Total Page Count',
text_placeholder_of_base_format_description: '[Available Placeholders] {value}:The formatted value',
text_counted_page_target_description: '[Allowed Targets] List (The ID of target List) or Report (Empty)',
text_feedback_in_project_site: 'Project Site',
text_feedback_in_github: 'GitHub Issues',
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ App.addLocale({
text_apply_locale_setting: '設定を反映するにはエディタの再読み込みが必要です。\n今すぐ設定を反映しますか?',
text_layout_force_edit_confirmation: 'このレイアウトは新しいバージョンのエディタで作成されているため、\n編集すると一部の設定情報が消失する可能性があります。\nそれでも開きますか?',
text_placeholder_of_pageno_description: '[利用可能なプレースホルダ] {page}:ページ番号, {total}:総ページ数',
text_placeholder_of_base_format_description: '[利用可能なプレースホルダ] {value}:書式が反映された値',
text_counted_page_target_description: '[指定可能な対象] リスト(対象リストID) or レポート(空)',
text_feedback_in_project_site: 'プロジェクトサイトへ',
text_feedback_in_github: 'GitHub Issues へ',
Expand Down