Updated toastr messages in openai.js to use translation function for better internationalization support.

9e71b70f75f8cbebde7d713ad17acf59b1db52fc

InterestingDarkness <computeridiot999@gmail.com>

1 files changed, +13 -13Ignore whitespace
public/scripts/openai.js+13 -13
@@ -5567,7 +5567,7 @@ async function onVertexAIValidateServiceAccount() {
55675567 const jsonContent = String($('#vertexai_service_account_json').val()).trim();
55685568
55695569 if (!jsonContent) {
55705570 toastr.error('t`Please enter Service Account JSON content'`);
55715571 return;
55725572 }
55735573
@@ -5577,14 +5577,14 @@ async function onVertexAIValidateServiceAccount() {
55775577 const missingFields = requiredFields.filter(field => !serviceAccount[field]);
55785578
55795579 if (missingFields.length > 0) {
55805580 toastr.error(t`Missing required fields: ${missingFields.join(', ')}`);
55815581 updateVertexAIServiceAccountStatus(false, t`Missing fields: ${missingFields.join(', ')}`);
55825582 return;
55835583 }
55845584
55855585 if (serviceAccount.type !== 'service_account') {
55865586 toastr.error('t`Invalid service account type. Expected "service_account"'`);
55875587 updateVertexAIServiceAccountStatus(false, 't`Invalid service account type'`);
55885588 return;
55895589 }
55905590
@@ -5598,12 +5598,12 @@ async function onVertexAIValidateServiceAccount() {
55985598 // Show success status
55995599 updateVertexAIServiceAccountStatus(true, `Project: ${serviceAccount.project_id}, Email: ${serviceAccount.client_email}`);
56005600
56015601 toastr.success('t`Service Account JSON is valid and saved securely'`);
56025602 saveSettingsDebounced();
56035603 } catch (error) {
56045604 console.error('JSON validation error:', error);
56055605 toastr.error('t`Invalid JSON format'`);
56065606 updateVertexAIServiceAccountStatus(false, 't`Invalid JSON format'`);
56075607 }
56085608}
56095609
@@ -5618,7 +5618,7 @@ async function onVertexAIClearServiceAccount() {
56185618 await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, '');
56195619
56205620 updateVertexAIServiceAccountStatus(false);
56215621 toastr.info('t`Service Account JSON cleared'`);
56225622 saveSettingsDebounced();
56235623}
56245624
@@ -5638,12 +5638,12 @@ function onVertexAIServiceAccountJsonChange() {
56385638 const hasAllFields = requiredFields.every(field => serviceAccount[field]);
56395639
56405640 if (hasAllFields && serviceAccount.type === 'service_account') {
56415641 updateVertexAIServiceAccountStatus(false, 't`JSON appears valid - click "Validate JSON" to save'`);
56425642 } else {
56435643 updateVertexAIServiceAccountStatus(false, 't`Incomplete or invalid JSON'`);
56445644 }
56455645 } catch (error) {
56465646 updateVertexAIServiceAccountStatus(false, 't`Invalid JSON format'`);
56475647 }
56485648 } else {
56495649 updateVertexAIServiceAccountStatus(false);
@@ -5665,7 +5665,7 @@ function updateVertexAIServiceAccountStatus(isValid = false, message = '') {
56655665 // If no explicit message provided, check if we have a saved service account
56665666 if (!message && secret_state[SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT]) {
56675667 isValid = true;
56685668 message = 't`Service Account JSON is saved and ready to use'`;
56695669 }
56705670
56715671 if (isValid && message) {