question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore certain domain (e.g. via an options.dontUpdateDomains)

See original GitHub issue

It would be great to be able to set certain text domains to be left alone, something along

options: {
            dontUpdateDomains: [ 'thirpartydomain' ]
}

My use case is that my theme does some slight modifications of markup via a plugin hook, but although the order of things shifts the actual string to translate remains the same as in the plugin. So it doesn’t really make sense to move/duplicate that string in my plugin. Now I could just ignore that file in target but that is an issue as the file does have other translatable strings with my own textdomain in it.

I know this probably is an edge case, but maybe I am not the only one having this issue. 😄

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
GaryJonescommented, Aug 18, 2017

That option would be to support a non-best practice.

IMO that creates an unnecessarily large burden on theme authors.

No, it provides very little burden - change a few extra textdomains and that’s it.

Any extra burden is on theme translators, and that’s just a few extra strings. And, if the strings are the same as the default WooCommerce templates, they can copy the translated strings from those language files. It’s literally just a few minutes extra work.

With something like WooCommerce, the amount of translated languages someone expects from the plugin is very high.

Sure - it could be in 100 locales, but that bears no relevance on the number of locales the theme is available in, so I don’t see what your point is here.

Forcing a theme author to provide parity because they override a couple of templates seems unrealistic to me.

How is it unrealistic? Practically, the only extra work is to change the textdomain on the strings in the template.

What will most likely happen in that situation is a whole bunch of strings will either be untranslated or only translated into the few languages that the theme author has been able to pull together.

Theme translators would still need to translate the other strings in the theme anyway, so there’s no point having the strings from WooCommerce magically translated if the rest of the theme strings are still in English.

I ran into something similar to this where I needed to pull in some core text strings without actually modifying them.

You’ve only got to look at Twenty Seventeen, Twenty Sixteen et al, to see that they also use WP Core strings, but with their own textdomain.

Same goes for Akismet using core strings but with its own textdomain as well.

For TGM Plugin Activation, the generator asks for the theme’s / plugin’s textdomain, so that the TGMPA file has strings that use that textdomain when used in a WordPress.org environment.

I get that we’d all prefer to keep everything DRY, but that’s not the best approach in this circumstance, and adapting this grunt-wp-i18n tool to facilitate folks making this mistake, would be a mistake in itself IMO.

2reactions
michakrappcommented, Aug 17, 2017

+1 for this.

Use case: Develop a theme / plugin for the woocommerce plugin. If you duplicate the woocommerce templates to your theme or using filters / actions to change the layout you may want to use the already translated strings from woocommerce itself.

Currently these strings get into your .pot file, but they are already translated, so no need to use them.

I would suggest (maybe additional to @kraftner idea) to be able to explicit set a domain which to process. So that only the strings from my theme / plugin gets added.

options: {
            textDomain: 'mydomain'
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Example of Filtering to Exclude Domains - VMware Docs
Extend the search exclusion list to exclude the DEPTX domain and all its trusted domains from the domain search for all Connection Server ......
Read more >
Windows HOSTS File PowerShell Script To Block Bad Domains
This article shows you how to use a free PowerShell script to block bad domain names by modifying the HOSTS file on Windows...
Read more >
window.open() parameters ignored when opening cross ...
open() when url is a different origin than the current domain. But works it works fine in Chrome and Firefox, and when the...
Read more >
Create and manage domains—ArcGIS Pro | Documentation
Using the Domains view, you can view existing domains and edit their properties and values, delete domains, and create domains. Learn more about...
Read more >
Geodatabase Domains in ArcGIS Pro - YouTube
This tutorial will demonstrate a workflow for establishing a domain within a geodatabase then applying the domain to an attribute within a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found