Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link popup "URL" to translatable strings #1097

Merged
merged 1 commit into from
May 6, 2020

Conversation

bertyhell
Copy link
Contributor

So people can add a different label if they want to.
I've made it backwards compatible by adding the || 'URL' since no translation file has this string yet.

So people can add a different label if they want to.
I've made it backwards compatible by adding the `|| 'URL'` since no translation file has this string yet.

People can then override this string by overriding the translation. eg:
`
($ as any).trumbowyg.langs.nl = {
	...($ as any).trumbowyg.langs.nl,
	url: 'Link',
	target: 'Open in',
};
`
@@ -1276,7 +1276,7 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {

var options = {
url: {
label: 'URL',
label: t.lang.linkUrl || 'URL',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just t.lang.url?

Copy link
Contributor Author

@bertyhell bertyhell May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the 'URL' string is used in other locations in your code and if you want to replace those as well, they might collide. eg: image URL

The translation of 'URL' in the context of a link might have a different translation than the 'URL' in context of an image url in various languages

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice catch :)

@bertyhell bertyhell requested a review from Alex-D May 6, 2020 15:13
@Alex-D Alex-D merged commit 98be1fb into Alex-D:develop May 6, 2020
@bertyhell bertyhell deleted the patch-1 branch May 7, 2020 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants