Comments (7)
Hi @bjrmatos,
What an excellent suggestion!
Currently, the only phrases/words that need to be localized are:
- "Hi {name}"
- "Yours truly"
- "All rights reserved"
I'm thinking it would be better if we would make it possible to let users override these phrases with their own, thereby also making it possible to localize them, as well as customize the English ones (some companies wouldn't want to end their e-mails with "Yours truly" for example).
I think it would simply be harder to internationalize each Mailgen theme into 20+ languages and would allow for less flexibility in the end.
So what I'm thinking is the following for overriding the copyright:
// Configure mailgen by setting a theme and your product info
var mailGenerator = new Mailgen({
theme: 'default',
product: {
name: 'Mailgen',
// Optional override theme's copyright notice
copyright: '(C) 2016 Mailgen.js'
}
});
And this is how you would override the rest:
var email = {
body: {
greeting: 'Dear', // Optionally override 'Hi'
name: 'John Appleseed',
intro: 'Welcome to Mailgen! We’re very excited to have you on board.',
outro: 'Need help, or have questions? Just reply to this email, we\'d love to help.',
signature: 'Sincerely' // Optionally override 'Yours truly'
}
};
This way, you can both customize and internationalize these static phrases in the templates.
What do you think @bjrmatos?
from mailgen.
I'm thinking it would be better if we would make it possible to let users override these phrases with their own, thereby also making it possible to localize them, as well as customize the English ones (some companies wouldn't want to end their e-mails with "Yours truly" for example).
I think it would simply be harder to internationalize each Mailgen theme into 20+ languages and would allow for less flexibility in the end.
yes, you're right it'll be harder with more themes, your approach sounds better to me 😄
in the case of new themes, each theme will need to define the custom properties that will allow override the phrases, right? sounds really good to me!
from mailgen.
@bjrmatos Yep! I'm thinking of simply adding new variables that will be available to the themes, e.g. product.copyright
, greeting
, and signature
, which can be overridden with user-supplied phrases.
These variables will fallback to the current English phrases if not supplied by the user.
from mailgen.
@bjrmatos Let me know if you'd like to work on this yourself, and if not, I'd be glad to do it as well. 👍
from mailgen.
@eladnava great! unfortunately i only have time on weekends, if you have time to implement this please do! if not i will take care of this in the coming weekend 👍
from mailgen.
@bjrmatos No problem! Found some time and implemented this:
https://github.com/eladnava/mailgen#language-customizations
Thanks again for your suggestion! =)
from mailgen.
you're awesome! ❤️
from mailgen.
Related Issues (20)
- Custom HTML element, or at least image HOT 1
- Action button -- alignment option in default theme? HOT 2
- Button Styling Looks Off In MS Outlook Web HOT 3
- Throws an error when using table in side body HOT 1
- JSON Schema for mailgen format available? HOT 2
- How to embed Images HOT 1
- product logo from local disk HOT 2
- adding and styling product images HOT 1
- Missing typescript definition for Product.logoHeigth HOT 1
- After npm install i got 5 high severity vulnerabilities HOT 2
- Email Layout Breaks in iOS Email App HOT 5
- body.table.columns type HOT 1
- Option to minify html template code. HOT 1
- Type issue for Button HOT 1
- Add text links for button actions HOT 8
- Cannot read property 'button' of undefined HOT 1
- Having buttons inside of tables HOT 2
- Attachment HOT 1
- greeting: false, // not working HOT 2
- add {year} 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 mailgen.