-
-
Notifications
You must be signed in to change notification settings - Fork 573
tolgee-localisation #41
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "src/components/LoginForm.jsx": { | ||
| "migrated": true, | ||
| "keys": [ | ||
| { | ||
| "name": "chat-application-title", | ||
| "description": "Error message shown when login credentials are incorrect", | ||
| "default": "Oops, incorrect credentials." | ||
| }, | ||
| { | ||
| "name": "start-chatting-button", | ||
| "description": "Title of the chat application displayed at the top of the login form", | ||
| "default": "Chat Application" | ||
|
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix mismatched key name and description. The key name 🤖 Prompt for AI Agents |
||
| }, | ||
| { | ||
| "name": "", | ||
| "description": "Placeholder text for the username input field", | ||
| "default": "Username" | ||
|
Comment on lines
+16
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Complete migration by adding key names. Multiple translation entries have empty key names, indicating incomplete migration. This will prevent proper localization functionality. These entries need proper key names assigned:
Also applies to: 21-23, 26-28, 36-36, 46-46, 56-56 🤖 Prompt for AI Agents |
||
| }, | ||
| { | ||
| "name": "", | ||
| "description": "Placeholder text for the password input field", | ||
| "default": "Password" | ||
| }, | ||
| { | ||
| "name": "", | ||
| "description": "Text for the button to start chatting after login", | ||
| "default": "Start chatting" | ||
| } | ||
| ] | ||
| }, | ||
| "src/components/MessageForm.jsx": { | ||
| "migrated": true, | ||
| "keys": [ | ||
| { | ||
| "name": "", | ||
| "description": "Placeholder text for the message input field in the chat", | ||
| "default": "Send a message..." | ||
| } | ||
| ] | ||
| }, | ||
| "src/components/MyMessage.jsx": { | ||
| "migrated": true, | ||
| "keys": [ | ||
| { | ||
| "name": "", | ||
| "description": "Alt text for message attachment image", | ||
| "default": "message-attachment" | ||
| } | ||
| ] | ||
| }, | ||
| "src/components/TheirMessage.jsx": { | ||
| "migrated": true, | ||
| "keys": [ | ||
| { | ||
| "name": "", | ||
| "description": "Alt text for message attachment image", | ||
| "default": "message-attachment" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| import { useState } from 'react'; | ||
| import axios from 'axios'; | ||
| import { T, useTranslate } from '@tolgee/react'; | ||
|
|
||
| const projectID = '1b7801d6-8a66-4be4-a442-89219d833dfc'; | ||
|
|
||
| const Modal = () => { | ||
| const { t } = useTranslate(); | ||
| const [username, setUsername] = useState(''); | ||
| const [password, setPassword] = useState(''); | ||
| const [error, setError] = useState(''); | ||
|
|
@@ -22,20 +24,25 @@ const Modal = () => { | |
| window.location.reload(); | ||
| setError(''); | ||
| } catch (err) { | ||
| setError('Oops, incorrect credentials.'); | ||
| setError( | ||
| t('incorrect-credentials-error')); | ||
|
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify translation key consistency. The code uses 🏁 Script executed: #!/bin/bash
# Verify translation key usage consistency across components and migration status
echo "Checking for 'incorrect-credentials-error' key usage..."
rg -A 2 -B 2 "incorrect-credentials-error"
echo "Checking migration status for error message configuration..."
jq '.["src/components/LoginForm.jsx"].keys[] | select(.description | contains("Error message"))' .tolgee/migration-status.jsonLength of output: 817 Translation key mismatch in migration-status.json The t('incorrect-credentials-error')but in {
"name": "chat-application-title",
"description": "Error message shown when login credentials are incorrect",
"default": "Oops, incorrect credentials."
}Please update it to: {
- "name": "chat-application-title",
+ "name": "incorrect-credentials-error",
"description": "Error message shown when login credentials are incorrect",
"default": "Oops, incorrect credentials."
}This will ensure the translation key in code and migration status stay in sync. 🤖 Prompt for AI Agents |
||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="wrapper"> | ||
| <div className="form"> | ||
| <h1 className="title">Chat Application</h1> | ||
| <h1 className="title"> | ||
| <T keyName="chat-application-title" /></h1> | ||
| <form onSubmit={handleSubmit}> | ||
| <input type="text" value={username} onChange={(e) => setUsername(e.target.value)} className="input" placeholder="Username" required /> | ||
| <input type="password" value={password} onChange={(e) => setPassword(e.target.value)} className="input" placeholder="Password" required /> | ||
| <input type="text" value={username} onChange={(e) => setUsername(e.target.value)} className="input" placeholder={ | ||
| t('username-input-placeholder')} required /> | ||
| <input type="password" value={password} onChange={(e) => setPassword(e.target.value)} className="input" placeholder={ | ||
| t('password-input-placeholder')} required /> | ||
| <div align="center"> | ||
| <button type="submit" className="button"> | ||
| <span>Start chatting</span> | ||
| <span> | ||
| <T keyName="start-chatting-button" /></span> | ||
| </button> | ||
| </div> | ||
| </form> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,8 @@ const MyMessage = ({ message }) => { | |||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||
| <img | ||||||||||||||||||||||||||||||||||||||||||
| src={message.attachments[0].file} | ||||||||||||||||||||||||||||||||||||||||||
| alt="message-attachment" | ||||||||||||||||||||||||||||||||||||||||||
| alt={ | ||||||||||||||||||||||||||||||||||||||||||
| t('message-attachment-alt')} | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing translation imports. The component uses Add the missing import and hook usage: +import { useTranslate } from '@tolgee/react';
+
const MyMessage = ({ message }) => {
+ const { t } = useTranslate();
if (message.attachments && message.attachments.length > 0) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| className="message-image" | ||||||||||||||||||||||||||||||||||||||||||
| style={{ float: 'right' }} | ||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -17,4 +18,4 @@ const MyMessage = ({ message }) => { | |||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| export default MyMessage; | ||||||||||||||||||||||||||||||||||||||||||
| export default MyMessage; | ||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,8 @@ const TheirMessage = ({ lastMessage, message }) => { | |||||||||||||||||
| ? ( | ||||||||||||||||||
| <img | ||||||||||||||||||
| src={message.attachments[0].file} | ||||||||||||||||||
| alt="message-attachment" | ||||||||||||||||||
| alt={ | ||||||||||||||||||
| t('message-attachment-alt')} | ||||||||||||||||||
|
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing translation imports. The component uses Add the missing import and hook usage: +import { useTranslate } from '@tolgee/react';
+
const TheirMessage = ({ lastMessage, message }) => {
+ const { t } = useTranslate();
const isFirstMessageByUser = !lastMessage || lastMessage.sender.username !== message.sender.username;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| className="message-image" | ||||||||||||||||||
| style={{ marginLeft: isFirstMessageByUser ? '4px' : '48px' }} | ||||||||||||||||||
| /> | ||||||||||||||||||
|
|
||||||||||||||||||
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.
Fix mismatched key name and description.
The key name
"chat-application-title"doesn't match the description "Error message shown when login credentials are incorrect". This appears to be a data integrity issue in the migration configuration.🤖 Prompt for AI Agents