-
Notifications
You must be signed in to change notification settings - Fork 4
Farabi/migration-to-deriv-com-translations #67
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
base: master
Are you sure you want to change the base?
Farabi/migration-to-deriv-com-translations #67
Conversation
|
Claude finished @farabi-deriv's task —— View job PR Review - Translation Migration & React 18 UpgradeTasks
Overall AssessmentThis is a well-executed migration that successfully modernizes the translation system and upgrades to React 18. The changes are comprehensive and follow good patterns. However, there are several critical issues and recommendations that should be addressed before merging. 🔴 Critical Issues1. Missing Environment Variable DocumentationSeverity: High The PR introduces three new required environment variables but provides no documentation:
Issues:
Recommendation: # Create .env.example with:
CROWDIN_URL=https://distributions.crowdin.net
R2_PROJECT_NAME=smarttrader
CROWDIN_BRANCH_NAME=stagingAdd setup instructions to the README explaining how to configure these for local development. 2. Translation Initialization May Fail SilentlyLocation: The error handling catches and logs errors but returns } catch (error) {
console.error('Failed to initialize SmartTrader translations:', error);
isInitialized = true; // ⚠️ Prevents retry but app continues with broken translations
return null;
}Issue: Setting Recommendation: Either:
3. React 18 Callback Timing IssueLocation: if (callback && typeof callback === 'function') {
setTimeout(callback, 0);
}Issue: Using Recommendation: Use if (callback && typeof callback === 'function') {
queueMicrotask(callback);
}Or better yet, if callbacks need DOM access, use import { flushSync } from 'react-dom';
flushSync(() => {
root.render(component);
});
if (callback) callback();4. Potential Memory Leak in Root ManagerLocation: The Recommendation: Add cleanup using
|
This pull request introduces significant improvements to translation management, environment variable handling, and dependency updates. The most notable changes are the addition of a workflow for syncing translations with Crowdin, the integration of new translation-related environment variables throughout the build and deployment process, and the modernization of dependencies to support React 18 and new testing libraries. Additionally, translation extraction scripts and legacy test files have been removed in favor of a new approach using the
@deriv-com/translationspackage.Translation management and automation:
.github/workflows/sync-translations.ymlworkflow to automate translation extraction and synchronization with Crowdin for both staging and production environments, leveraging new secrets and variables for secure access and configuration.R2_PROJECT_NAME,CROWDIN_URL,CROWDIN_BRANCH_NAME) into the build steps for production and staging workflows to support translation sync and deployment.@deriv-com/translationspackage.Dependency updates and modernization:
dotenvand@deriv-com/translations, and removed legacy translation dependencies (node-gettext,gettext-parser,react-render-html).Build and environment setup:
.envfiles in the build initialization script to simplify configuration management.Codebase cleanup and translation extraction refactor:
Development server and routing simplification: