@@ -15,11 +15,14 @@ module.exports = function (context, options) {
1515 * Generates the markdown files for all components in a given version.
1616 * @param {* } version The version, e.g.: v6
1717 * @param {* } npmTag The npm tag, e.g.: 6 or next
18+ * @param {* } lang The language, e.g.: en or ja
1819 * @param {* } isCurrentVersion Whether or not this is the current version of the docs
1920 */
20- const generateMarkdownForVersion = async ( version , npmTag , isCurrentVersion ) => {
21+ const generateMarkdownForVersion = async ( version , npmTag , lang , isCurrentVersion ) => {
2122 let COMPONENT_LINK_REGEXP ;
22- const response = await fetch ( `https://unpkg.com/@ionic/docs@${ npmTag } /core.json` ) ;
23+ const response = isCurrentVersion && lang === 'ja'
24+ ? await fetch ( `https://raw.githubusercontent.com/ionic-jp/ionic-docs/main/scripts/data/translated-api.json` )
25+ : await fetch ( `https://unpkg.com/@ionic/docs@${ npmTag } /core.json` ) ;
2326 const { components } = await response . json ( ) ;
2427
2528 const names = components . map ( ( component ) => component . tag . slice ( 4 ) ) ;
@@ -47,7 +50,7 @@ module.exports = function (context, options) {
4750 for ( const version of options . versions ) {
4851 const npmTag = version . slice ( 1 ) ;
4952
50- await generateMarkdownForVersion ( version , npmTag , false ) ;
53+ await generateMarkdownForVersion ( version , npmTag , context . i18n . currentLocale , false ) ;
5154 }
5255
5356 let npmTag = 'latest' ;
@@ -57,7 +60,7 @@ module.exports = function (context, options) {
5760 npmTag = currentVersion . path . slice ( 1 ) ;
5861 }
5962 // Latest version
60- await generateMarkdownForVersion ( currentVersion . path || currentVersion . label , npmTag , true ) ;
63+ await generateMarkdownForVersion ( currentVersion . path || currentVersion . label , npmTag , context . i18n . currentLocale , true ) ;
6164
6265 return data ;
6366 } ,
@@ -83,6 +86,7 @@ module.exports = function (context, options) {
8386
8487 await Promise . all ( promises ) ;
8588 } ,
89+
8690 configureWebpack ( config , isServer , utils ) {
8791 /**
8892 * Adds a custom import alias to the webpack configuration, so that the markdown files
0 commit comments