From 7170e93b3927ed7d2803cd78ce62741696a4b652 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 26 Nov 2018 17:35:38 -0500 Subject: [PATCH] Adjust tooltip --- data/core.yaml | 3 +-- dist/locales/en.json | 3 +-- modules/ui/fields/input.js | 4 +++- modules/ui/fields/localized.js | 8 ++++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 54d513dbf..2dd677743 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -439,8 +439,7 @@ en: location: Location add_fields: "Add field:" lock: - brand: 'This brand name is locked. You can delete it or edit the tags in the "All tags" section.' - official: 'This official name is locked. You can delete it or edit the tags in the "All tags" section.' + suggestion: 'The "{label}" field is locked because there is a wikidata tag. You can delete it or edit the tags in the "All tags" section.' background: title: Background description: Background settings diff --git a/dist/locales/en.json b/dist/locales/en.json index c25a151d3..147d0c366 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -536,8 +536,7 @@ "location": "Location", "add_fields": "Add field:", "lock": { - "brand": "This brand name is locked. You can delete it or edit the tags in the \"All tags\" section.", - "official": "This official name is locked. You can delete it or edit the tags in the \"All tags\" section." + "suggestion": "The \"{label}\" field is locked because there is a wikidata tag. You can delete it or edit the tags in the \"All tags\" section." } }, "background": { diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index ba21fa70e..a667138e4 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -32,7 +32,9 @@ export function uiFieldText(field, context) { var _brandTip; if (field.id === 'brand') { - _brandTip = tooltip().title(t('inspector.lock.brand')).placement('bottom'); + _brandTip = tooltip() + .title(t('inspector.lock.suggestion', { label: field.label })) + .placement('bottom'); } diff --git a/modules/ui/fields/localized.js b/modules/ui/fields/localized.js index 28b8d2fb9..2f7c2b50a 100644 --- a/modules/ui/fields/localized.js +++ b/modules/ui/fields/localized.js @@ -31,8 +31,12 @@ export function uiFieldLocalized(field, context) { var _selection = d3_select(null); var _multilingual = []; var _isLocked = false; - var _brandTip = tooltip().title(t('inspector.lock.brand')).placement('bottom'); - var _buttonTip = tooltip().title(t('translate.translate')).placement('left'); + var _brandTip = tooltip() + .title(t('inspector.lock.suggestion', { label: field.label })) + .placement('bottom'); + var _buttonTip = tooltip() + .title(t('translate.translate')) + .placement('left'); var _wikiTitles; var _entity;