Comments (5)
Looks good and seems easier.
from edd-theme-updater.
4526754 extracts the remaining strings and requires them to be passed when EDD_Theme_Updater_Admin is set up. This allows them to be easily overridden and translated, but I'm also not sure this is the best approach.
Here's the alternate I considered:
Put all the strings into a function that is filtered
When a string is needed, the function is called and filters can be applied by the theme (or plugin).
Questions for this approach:
- What textdomain should be used for those strings? (pass textdomain as a variable, use unique textdomain, have theme author change textdomain)
Benefits: Most developers will not be changing the strings, so it makes sense not to surface them in theme-updater.php if they're not needed.
This approach can also be combined with approach I'm currently using. Passing the string arguments from theme-updater.php would just be optional.
from edd-theme-updater.
Text domains should never be passed as variables: http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/
I love the idea of strings all being easily accessible.
from edd-theme-updater.
Do you like them surfaced in the config? https://github.com/devinsays/edd-theme-updater/blob/master/updater/theme-updater.php
Or do you think it would make more sense to bury them in the class (easily overridden + filterable)?
from edd-theme-updater.
When the .pot file is generated- it doesn't seem to matter what the text domain is set as. Moved the strings back into the class. This is the way I'd prefer to do it as long as long as it doesn't mess up anything for translators. 0455746
from edd-theme-updater.
Related Issues (12)
- Renew license link HOT 12
- Works on multisite HOT 2
- Edd checkout uri HOT 9
- Admin notice HOT 4
- Lifetime license HOT 1
- Variable inside gettext function. HOT 1
- Child Theme
- Theme version HOT 4
- Still need to click Activate License button HOT 5
- List Site Counts (for activated license) HOT 2
- Move admin functions into a separate file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edd-theme-updater.