|
@@ -191,13 +191,21 @@ function injectLocaleList () {
|
|
|
|
|
|
glob.sync(localePackagePath).forEach((localePath) => {
|
|
|
const localeName = path.basename(localePath, '.js')
|
|
|
- const localeNameWithDash = localeName.replace('_', '-')
|
|
|
+ let localeNameWithDash = localeName.replace('_', '-')
|
|
|
+
|
|
|
+ const parts = localeNameWithDash.split('-')
|
|
|
+ let variant = ''
|
|
|
+ if (parts.length > 2) {
|
|
|
+ variant = parts.pop()
|
|
|
+ localeNameWithDash = parts.join('-')
|
|
|
+ }
|
|
|
+
|
|
|
const languageName = LocaleCode.getLanguageName(localeNameWithDash)
|
|
|
const countryName = LocaleCode.getCountryName(localeNameWithDash)
|
|
|
const npmPath = `<code><a href="https://www.npmjs.com/package/@uppy/locales">@uppy/locales</a>/lib/${localeName}</code>`
|
|
|
const cdnPath = `[\`${localeName}.min.js\`](https://transloadit.edgly.net/releases/uppy/v${localePackageVersion}/locales/${localeName}.min.js)`
|
|
|
const githubSource = `[\`${localeName}.js\`](https://github.com/transloadit/uppy/blob/master/packages/%40uppy/locales/src/${localeName}.js)`
|
|
|
- const mdTableRow = `| ${languageName}<br/> <small>(${countryName})</small> | ${npmPath} | ${cdnPath} | ✏️ ${githubSource} |`
|
|
|
+ const mdTableRow = `| ${languageName}<br/> <small>(${countryName}${variant ? `, ${variant}` : ''})</small> | ${npmPath} | ${cdnPath} | ✏️ ${githubSource} |`
|
|
|
mdRows.push(mdTableRow)
|
|
|
})
|
|
|
|