-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix assignment path with kz locale #35
Conversation
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.
Также предложу заодно обновить список версий нод на каких тестируем
node-version: [14, 16, 18]
Например взять крайние версии и одну среднюю - [14, 18, 21]
src/utils/assignments.js
Outdated
@@ -36,7 +36,8 @@ const getLessonData = (lessonUrl) => { | |||
}; | |||
|
|||
const generateAssignmentPath = (repoPath, courseSlug, lessonSlug, locale) => { | |||
const courseSlugWithLocale = locale === 'en' ? courseSlug : `${courseSlug}-${locale}`; | |||
const normalizedLocale = locale === 'kz' ? 'ru' : locale; | |||
const courseSlugWithLocale = locale === 'en' ? courseSlug : `${courseSlug}-${normalizedLocale}`; |
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.
locale === 'en' так а тут уже по идее надо использовать локаль полученную на предыдущем шаге normalizedLocale
src/utils/assignments.js
Outdated
@@ -36,7 +36,8 @@ const getLessonData = (lessonUrl) => { | |||
}; | |||
|
|||
const generateAssignmentPath = (repoPath, courseSlug, lessonSlug, locale) => { | |||
const courseSlugWithLocale = locale === 'en' ? courseSlug : `${courseSlug}-${locale}`; | |||
const normalizedLocale = locale === 'kz' ? 'ru' : locale; |
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.
давай просто определим константу на уровне модуля - объект с маппингом локалей на языки
const contentLocales = {
ru: 'ru',
kz: 'ru',
en: 'en',
es: 'es',
};
и будем юзать там где нужно
contentLocales[locale]
@@ -11,11 +11,11 @@ const assignmentResetCmd = require('../../src/commands/assignment/reset.js'); | |||
const { initSettings } = require('../../src/config.js'); | |||
const { readDirP, getFixturePath, getAssignmentConfig } = require('../helpers/index.js'); | |||
|
|||
const buildLessonUrl = (courseSlug, lessonSlug) => ( | |||
`https://ru.hexlet.io/courses/${courseSlug}/lessons/${lessonSlug}/theory_unit` | |||
const buildLessonUrl = (locale, courseSlug, lessonSlug) => ( |
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.
кажется что проще добавить локаль третим параметром с дефолтным значением ru
И тогда достаточно будет поставить только там где кастом - kz
No description provided.