feat(i18n): add French language support and enhance localization
All checks were successful
Deploy to production / deploy (push) Successful in 2m48s
All checks were successful
Deploy to production / deploy (push) Successful in 2m48s
- Introduced French as a supported language across the application, updating locale files and adding translations for various components. - Enhanced language handling logic to accommodate French, ensuring proper detection and fallback mechanisms. - Updated UI elements to include French language options, improving accessibility for French-speaking users. - Refactored SEO handling to include French in hreflang links, enhancing search engine indexing for multilingual content. - Added new scripts for managing French translations and ensuring consistency across language files.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
/** @type {import('sequelize-cli').Migration} */
|
||||
module.exports = {
|
||||
async up(queryInterface) {
|
||||
await queryInterface.sequelize.query(`
|
||||
INSERT INTO type.user_param_value (user_param_type_id, value, order_id)
|
||||
SELECT upt.id, 'fr', COALESCE(
|
||||
(SELECT MAX(v.order_id) FROM type.user_param_value v WHERE v.user_param_type_id = upt.id),
|
||||
0
|
||||
) + 1
|
||||
FROM type.user_param upt
|
||||
WHERE upt.description = 'language'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM type.user_param_value x
|
||||
WHERE x.user_param_type_id = upt.id AND x.value = 'fr'
|
||||
);
|
||||
`);
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.sequelize.query(`
|
||||
DELETE FROM type.user_param_value v
|
||||
USING type.user_param upt
|
||||
WHERE v.user_param_type_id = upt.id
|
||||
AND upt.description = 'language'
|
||||
AND v.value = 'fr';
|
||||
`);
|
||||
},
|
||||
};
|
||||
@@ -144,7 +144,7 @@ export const loginUser = async ({ username, password }) => {
|
||||
const mappedParams = params.map(param => {
|
||||
return { 'name': param.paramType.description, 'value': param.value };
|
||||
});
|
||||
const uiLocaleCodes = ['de', 'en', 'ceb', 'es'];
|
||||
const uiLocaleCodes = ['de', 'en', 'ceb', 'es', 'fr'];
|
||||
const langEntry = mappedParams.find((p) => p.name === 'language');
|
||||
if (langEntry?.value && !uiLocaleCodes.includes(langEntry.value)) {
|
||||
const idNum = parseInt(langEntry.value, 10);
|
||||
|
||||
@@ -67,7 +67,7 @@ const initializeTypes = async () => {
|
||||
}
|
||||
const valuesList = {
|
||||
gender: ['male', 'female', 'transfemale', 'transmale', 'nonbinary'],
|
||||
language: ['de', 'en', 'ceb', 'es'],
|
||||
language: ['de', 'en', 'ceb', 'es', 'fr'],
|
||||
eyecolor: ['blue', 'green', 'brown', 'black', 'grey', 'hazel', 'amber', 'red', 'other'],
|
||||
haircolor: ['black', 'brown', 'blonde', 'red', 'grey', 'white', 'other'],
|
||||
hairlength: ['short', 'medium', 'long', 'bald', 'other'],
|
||||
|
||||
Reference in New Issue
Block a user