Skip to content

Commit

Permalink
Added translation in Ukranian for categories and subjects (#2860)
Browse files Browse the repository at this point in the history
* Added subjects categories localization in en and uk jsons

* added translation for dropdowns and for professional category card

* added translation to categories and subjects page

* modified test

* Modified test AddProfessionalCategoryModal

* Modified tests PopularCategories

* removed duplicates

* remade json to camelCase, fixed tests and uuid

* fixed categories tests
  • Loading branch information
amoutens authored Nov 28, 2024
1 parent 2e19d6b commit ff59e01
Show file tree
Hide file tree
Showing 19 changed files with 538 additions and 65 deletions.
5 changes: 4 additions & 1 deletion src/components/popular-categories/PopularCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from '~/utils/helper-functions'
import { CategoryInterface, ItemsWithCount, SortEnum } from '~/types'
import { styles } from '~/components/popular-categories/PopularCategories.styles'
import { titleToCamel } from '~/utils/title-to-camel-case'

interface PopularCategoriesProps {
title: string
Expand Down Expand Up @@ -68,7 +69,9 @@ const PopularCategories: FC<PopularCategoriesProps> = ({
iconColor={item.appearance.color}
key={item._id}
link={`${authRoutes.subjects.path}?categoryId=${item._id}`}
title={item.name}
title={t(`categories.${titleToCamel(item.name)}`, {
defaultValue: item.name
})}
/>
)),
[response.items, oppositeRole, t]
Expand Down
19 changes: 19 additions & 0 deletions src/constants/translations/en/categories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"computerScience": "Computer science",
"music": "Music",
"psychology": "Psychology",
"finances": "Finances",
"audit": "Audit",
"astronomy": "Astronomy",
"biology": "Biology",
"cooking": "Cooking",
"languages": "Languages",
"painting": "Painting",
"design": "Design",
"marketing": "Marketing",
"it": "IT",
"mathematics": "Mathematics",
"chemistry": "Chemistry",
"physics": "Physics",
"history": "History"
}
6 changes: 5 additions & 1 deletion src/constants/translations/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import editProfilePage from './edit-profile.json'
import quiz from './quiz.json'
import bookmarkedOffers from './bookmarked-offers-page.json'
import activeStudents from './active-students.json'
import categories from './categories.json'
import subjects from './subjects.json'

const en = {
translations: {
Expand Down Expand Up @@ -94,7 +96,9 @@ const en = {
editProfilePage,
quiz,
bookmarkedOffers,
activeStudents
activeStudents,
categories,
subjects
}
}

Expand Down
155 changes: 155 additions & 0 deletions src/constants/translations/en/subjects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"abstractPainting": "Abstract Painting",
"accounting": "Accounting",
"acrylicPainting": "Acrylic Painting",
"advertising": "Advertising",
"africanHistory": "African History",
"algebra": "Algebra",
"americanHistory": "American History",
"analyticalChemistry": "Analytical Chemistry",
"anatomy": "Anatomy",
"ancientHistory": "Ancient History",
"arabic": "Arabic",
"artificialIntelligence": "Artificial Intelligence",
"asianHistory": "Asian History",
"astrophysics": "Astrophysics",
"biochemistry": "Biochemistry",
"botany": "Botany",
"brandManagement": "Brand Management",
"calculus": "Calculus",
"cellBiology": "Cell Biology",
"chinese": "Chinese",
"classicalMechanics": "Classical Mechanics",
"clinicalPsychology": "Clinical Psychology",
"cognitivePsychology": "Cognitive Psychology",
"complianceAudit": "Compliance Audit",
"computerNetworks": "Computer Networks",
"consumerBehavior": "Consumer Behavior",
"contentMarketing": "Content Marketing",
"corporateFinance": "Corporate Finance",
"cosmology": "Cosmology",
"culturalHistory": "Cultural History",
"cybersecurity": "Cybersecurity",
"dataStructuresAndAlgorithms": "Data Structures and Algorithms",
"databaseManagementSystems": "Database Management Systems",
"designThinking": "Design Thinking",
"developmentalPsychology": "Developmental Psychology",
"differentialEquations": "Differential Equations",
"digitalMarketing": "Digital Marketing",
"discreteMathematics": "Discrete Mathematics",
"ecology": "Ecology",
"economics": "Economics",
"educationalPsychology": "Educational Psychology",
"electromagnetism": "Electromagnetism",
"english": "English",
"environmentalAudit": "Environmental Audit",
"environmentalChemistry": "Environmental Chemistry",
"ethnomusicology": "Ethnomusicology",
"europeanHistory": "European History",
"evolutionaryBiology": "Evolutionary Biology",
"experimentalPsychology": "Experimental Psychology",
"externalAudit": "External Audit",
"fashionDesign": "Fashion Design",
"financialAnalysis": "Financial Analysis",
"financialAudit": "Financial Audit",
"financialMarkets": "Financial Markets",
"financialPlanning": "Financial Planning",
"fluidDynamics": "Fluid Dynamics",
"forensicAudit": "Forensic Audit",
"forensicPsychology": "Forensic Psychology",
"french": "French",
"galacticAstronomy": "Galactic Astronomy",
"gameDevelopment": "Game Development",
"gastronomy": "Gastronomy",
"genetics": "Genetics",
"geometry": "Geometry",
"german": "German",
"graphicDesign": "Graphic Design",
"gravitationalAstronomy": "Gravitational Astronomy",
"guitar": "Guitar",
"healthPsychology": "Health Psychology",
"highEnergyAstrophysics": "High-energy Astrophysics",
"itAudit": "IT Audit",
"industrialDesign": "Industrial Design",
"industrialOrganizationalPsychology": "Industrial-Organizational Psychology",
"inorganicChemistry": "Inorganic Chemistry",
"interiorDesign": "Interior Design",
"internalAudit": "Internal Audit",
"internationalFinance": "International Finance",
"introductionToProgramming": "Introduction to Programming",
"investments": "Investments",
"italian": "Italian",
"japanese": "Japanese",
"jazzStudies": "Jazz Studies",
"landscapePainting": "Landscape Painting",
"linearAlgebra": "Linear Algebra",
"machineLearning": "Machine Learning",
"marketResearch": "Market Research",
"marketingAnalytics": "Marketing Analytics",
"mathematicalLogic": "Mathematical Logic",
"medicinalChemistry": "Medicinal Chemistry",
"medievalHistory": "Medieval History",
"microbiology": "Microbiology",
"militaryHistory": "Military History",
"mixedMediaPainting": "Mixed Media Painting",
"modernHistory": "Modern History",
"motionDesign": "Motion Design",
"musicComposition": "Music Composition",
"musicHistory": "Music History",
"musicProduction": "Music Production",
"musicTheory": "Music Theory",
"neuropsychology": "Neuropsychology",
"nuclearChemistry": "Nuclear Chemistry",
"nuclearPhysics": "Nuclear Physics",
"numberTheory": "Number Theory",
"observationalAstronomy": "Observational Astronomy",
"oilPainting": "Oil Painting",
"operatingSystems": "Operating Systems",
"operationalAudit": "Operational Audit",
"optics": "Optics",
"organicChemistry": "Organic Chemistry",
"particlePhysics": "Particle Physics",
"pastelPainting": "Pastel Painting",
"personalFinance": "Personal Finance",
"physicalChemistry": "Physical Chemistry",
"physiology": "Physiology",
"piano": "Piano",
"planetaryScience": "Planetary Science",
"polymerChemistry": "Polymer Chemistry",
"portraitPainting": "Portrait Painting",
"portuguese": "Portuguese",
"productDesign": "Product Design",
"publicRelations": "Public Relations",
"qualityAudit": "Quality Audit",
"quantumMechanics": "Quantum Mechanics",
"radioAstronomy": "Radio Astronomy",
"realisticPainting": "Realistic Painting",
"riskManagement": "Risk Management",
"salesManagement": "Sales Management",
"socialMediaMarketing": "Social Media Marketing",
"socialPsychology": "Social Psychology",
"softwareEngineering": "Software Engineering",
"solarAstronomy": "Solar Astronomy",
"solidStatePhysics": "Solid State Physics",
"spanish": "Spanish",
"statistics": "Statistics",
"stellarAstronomy": "Stellar Astronomy",
"stillLifePainting": "Still Life Painting",
"taxAudit": "Tax Audit",
"testing": "Testing",
"theoreticalChemistry": "Theoretical Chemistry",
"thermodynamics": "Thermodynamics",
"trigonometry": "Trigonometry",
"typography": "Typography",
"uiUxDesign": "UI/UX Design",
"ukrainian": "Ukrainian",
"userExperienceUxDesign": "User Experience (UX) Design",
"violin": "Violin",
"voiceTraining": "Voice Training",
"watercolorPainting": "Watercolor Painting",
"webDesign": "Web Design",
"webDevelopment": "Web Development",
"worldHistory": "World History",
"zoology": "Zoology"
}

19 changes: 19 additions & 0 deletions src/constants/translations/uk/categories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"computerScience": "Комп'ютерні науки",
"music": "Музика",
"psychology": "Психологія",
"finances": "Фінанси",
"audit": "Аудит",
"astronomy": "Астрономія",
"biology": "Біологія",
"cooking": "Готування",
"languages": "Мови",
"painting": "Малювання",
"design": "Дизайн",
"marketing": "Маркетинг",
"it": "Програмування",
"mathematics": "Математика",
"chemistry": "Хімія",
"physics": "Фізика",
"history": "Історія"
}
6 changes: 5 additions & 1 deletion src/constants/translations/uk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import userProfilePage from './user-profile-page.json'
import quiz from './quiz.json'
import bookmarkedOffers from './bookmarked-offers-page.json'
import activeStudents from './active-students.json'
import categories from './categories.json'
import subjects from './subjects.json'

const uk = {
translations: {
Expand Down Expand Up @@ -94,7 +96,9 @@ const uk = {
userProfilePage,
quiz,
bookmarkedOffers,
activeStudents
activeStudents,
categories,
subjects
}
}

Expand Down
Loading

0 comments on commit ff59e01

Please sign in to comment.