-
Notifications
You must be signed in to change notification settings - Fork 14
Added support for multiple locales per template file #399
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
Added support for multiple locales per template file #399
Conversation
| SectionsCreated = [], | ||
| { privatesAccessor } = require('@medable/mdctl-core-utils/privates') | ||
|
|
||
| let hashCode = function (str, seed = 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add this function mdctl-node-utils package https://github.com/Medable/mdctl/blob/master/packages/mdctl-node-utils/crypto.js and use crypto that already exists.
| } | ||
| } | ||
|
|
||
| extractTemplatesGrouped() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if extractTemplates is not longer used please remove or use the same method name.
017d414 to
0e2b334
Compare
0e2b334 to
c2db522
Compare
packages/mdctl-node-utils/crypto.js
Outdated
| return hash.digest('hex') | ||
| } | ||
|
|
||
| function hashCode(str, seed = 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I said you could use crypto I mean you could use this
const hash = createHash('md5')
hash.update(str)
return hash.digest('hex')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll change it to this
1748e82 to
44b13ad
Compare
44b13ad to
4b42bd0
Compare
Required by i18n Initiative.
Multiple locales supported via array per template file. New fn is backward compatible as well for the old style of export.
If one locale, then template file is named according to that. If multiple, then its a hash of the locales array. Otherwise, if it is * then the template file is named anyLocale.
Things to consider: