Skip to content

Commit 5594224

Browse files
committed
Merge pull request #52 from maeda-m/placeholder-text-of-base-format
Added placeholder text of base format description in Property
2 parents c9dcbfb + 7a44ae2 commit 5594224

6 files changed

Lines changed: 50 additions & 1 deletion

File tree

src/app.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ App.getLocales = function() {
5454
};
5555

5656

57+
/**
58+
* @return {string} default locale
59+
*/
60+
App.getDefaultUILocale = function() {
61+
return App.DEFAULT_LOCALE;
62+
};
63+
64+
5765
/**
5866
* @return {string} browser locale
5967
*/

src/app/core/multipleshapeshelper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,8 @@ thin.core.MultipleShapesHelper.prototype.createPropertyComponent_ = function() {
11471147

11481148
var baseFormatInputProperty = new thin.ui.PropertyPane.InputProperty(thin.t('field_basic_format'));
11491149
var baseFormatInput = baseFormatInputProperty.getValueControl();
1150+
baseFormatInput.setTooltip(thin.t('text_placeholder_of_base_format_description'));
1151+
11501152
baseFormatInputProperty.addEventListener(propEventType.CHANGE, function(e) {
11511153

11521154
var formatBase = e.target.getValue();

src/app/core/tblockshape.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,8 @@ thin.core.TblockShape.prototype.createPropertyComponent_ = function() {
13171317

13181318
var baseFormatInputProperty = new thin.ui.PropertyPane.InputProperty(thin.t('field_basic_format'));
13191319
var baseFormatInput = baseFormatInputProperty.getValueControl();
1320+
baseFormatInput.setTooltip(thin.t('text_placeholder_of_base_format_description'));
1321+
13201322
baseFormatInputProperty.addEventListener(propEventType.CHANGE,
13211323
function(e) {
13221324

src/app/i18n.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ thin.i18n.currentLocaleId_;
4141
thin.i18n.translations_;
4242

4343

44+
/**
45+
* @type {Object}
46+
* @private
47+
*/
48+
thin.i18n.defaultLocale_;
49+
50+
51+
/**
52+
* @type {Object}
53+
* @private
54+
*/
55+
thin.i18n.defaultTranslations_;
56+
57+
4458
/**
4559
* @param {string} name
4660
* @param {Object=} opt_values
@@ -49,7 +63,9 @@ thin.i18n.translations_;
4963
thin.i18n.translate = function(name, opt_values) {
5064
var i18n = thin.i18n;
5165
var msg = i18n.makeMessage_(
52-
i18n.getMessages()[name], opt_values) || '';
66+
i18n.getMessages()[name] ||
67+
i18n.getDefaultMessages()[name], opt_values) || '';
68+
5369
return goog.string.newLineToBr(goog.string.htmlEscape(msg));
5470
};
5571

@@ -91,6 +107,19 @@ thin.i18n.getMessages = function() {
91107
};
92108

93109

110+
/**
111+
* @return {Object}
112+
*/
113+
thin.i18n.getDefaultMessages = function() {
114+
var i18n = thin.i18n;
115+
116+
if (!i18n.defaultTranslations_) {
117+
i18n.defaultTranslations_ = /** @type {Object} */(i18n.defaultLocale_['messages']);
118+
}
119+
return i18n.defaultTranslations_;
120+
};
121+
122+
94123
/**
95124
* @return {string}
96125
*/
@@ -133,6 +162,12 @@ thin.i18n.init = function() {
133162

134163
i18n.currentLocaleId_ = localeId;
135164
i18n.currentLocale_ = locale;
165+
166+
var defaultLocaleId = thin.callApp('getDefaultUILocale');
167+
i18n.defaultLocaleId_ = defaultLocaleId;
168+
i18n.defaultLocale_ = goog.array.find(locales, function(loc) {
169+
return loc.id == defaultLocaleId;
170+
});
136171
};
137172

138173

src/locales/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ App.addLocale({
224224
text_apply_locale_setting: 'After reloading the Editor, the setting will be applied.\nDo you want to apply now?',
225225
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?',
226226
text_placeholder_of_pageno_description: '[Available Placeholders] {page}:Page Number, {total}:Total Page Count',
227+
text_placeholder_of_base_format_description: '[Available Placeholders] {value}:The formatted value',
227228
text_counted_page_target_description: '[Allowed Targets] List (The ID of target List) or Report (Empty)',
228229
text_feedback_in_project_site: 'Project Site',
229230
text_feedback_in_github: 'GitHub Issues',

src/locales/ja.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ App.addLocale({
222222
text_apply_locale_setting: '設定を反映するにはエディタの再読み込みが必要です。\n今すぐ設定を反映しますか?',
223223
text_layout_force_edit_confirmation: 'このレイアウトは新しいバージョンのエディタで作成されているため、\n編集すると一部の設定情報が消失する可能性があります。\nそれでも開きますか?',
224224
text_placeholder_of_pageno_description: '[利用可能なプレースホルダ] {page}:ページ番号, {total}:総ページ数',
225+
text_placeholder_of_base_format_description: '[利用可能なプレースホルダ] {value}:書式が反映された値',
225226
text_counted_page_target_description: '[指定可能な対象] リスト(対象リストID) or レポート(空)',
226227
text_feedback_in_project_site: 'プロジェクトサイトへ',
227228
text_feedback_in_github: 'GitHub Issues へ',

0 commit comments

Comments
 (0)