Skip to content

feat: Locales#4855

Merged
zhanweizhang7 merged 1 commit intov2from
pr@v2@feat_locales
Mar 10, 2026
Merged

feat: Locales#4855
zhanweizhang7 merged 1 commit intov2from
pr@v2@feat_locales

Conversation

@shaohuzhang1
Copy link
Contributor

feat: Locales

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 10, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 10, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

:placeholder="t('views.trigger.triggerCycle.placeholder')"
clearable
@blur="validateCron"
@input="validateCron"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code looks generally clean, but there are some potential improvements:

Potential Issues and Optimization Suggestions

  1. Translation Key Naming:

    • Ensure that all translation keys ($t calls) follow consistent naming conventions. For example, consider using triggerCyclePlaceholder instead of views.trigger.triggerCycle.placeholder.
  2. Code Clarity:

    • The condition logic can be made more readable by breaking it down into separate if statements.

Here's an optimized version of the code with minor adjustments:

@@ -80,7 +80,7 @@
               <p style="margin-top: -8px">
                 {{
                   form.trigger_setting.schedule_type === 'cron'
-                      ? 'Cron表达式'
+                      : $t('views.trigger.triggerCycle.title')
                 }}
               </p>

               <el-tooltip
@@ -89,7 +89,7 @@
         :disabled="(form.is_edit || !showForm)"
       />
     </el-form-item>
     -->
 
-    <el-form-item v-if="form.trigger_setting.schedule_type !== 'cron'" prop="cron_expression">
      <!-- This part is currently commented out -->

@@ -114,10 +114,11 @@
           @input="validateCron"
         />
       </template>
+
     </el-form-item>
   </div>
 </div>

These changes enhance readability and ensure consistency in translation key usage. If you have specific feedback regarding translations or other aspects please let me know!


},
type: {
scheduled: 'Scheduled Trigger',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code looks generally correct from an English standpoint. However, there are a few minor suggestions and points for consideration:

Suggestions:

  1. Whitespace: Ensure consistent indentation to improve readability.
  2. Comments: Add comments where applicable to explain complex logic or sections of the code.

Here's the updated version with some improvements:

export default {
  title: 'Settings', // Translation key
  textFields: {
    hour: 'Hour',
    minute: 'Minute',
    second: 'Second', // Assuming this is also a translation key
    dayOfMonth: 'Day of Month',
    month: 'Month',
    year: 'Year'
  },
  buttons: {
    createTrigger: 'Create Trigger',
    saveChanges: 'Save Changes',
    cancel: 'Cancel'
  },
  labels: {
    scheduleType: 'Schedule Type:',
    timeZone: 'Time Zone:'
  },
  notifications: {
    savedSuccessfully: 'Successfully saved!',
    canceledOperation: 'Operation canceled.'
  },
  daysOfWeek: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
  timeFormat: 'HH:mm:ss',
  errorMessages: {
    invalidInput: 'Invalid input.',
    requiredField: '* Field is required.'
  }
};

type { Scheduled = "scheduled", Custom = "custom" }; // TypeScript definitions if needed

Potential Issues and Optimization Suggestions:

  • Consistency: Ensure consistency in naming conventions across all keys (title, labels, etc.) to prevent confusion.
  • Error Handling: Implement proper error handling in your application logic instead of relying solely on predefined messages.
  • Localization: Consider adding support for other languages, especially if the app will be used internationally.

Let me know if you need further assistance!

placeholder: '请输入Cron表达式(如:0 0 1 * *)'
},
type: {
scheduled: '定时触发',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code provided is for a localization file for a text editor interface that appears to use Chinese as its base language. The main issue with this translation could be the spelling of "cronExpression," which should be consistent and correctly spelled in both languages. If not already corrected, make sure it looks like:

export default {
    /**
     * 日语翻译文件
     */
    ja: {
        name: "日語",
        monday: '月曜日', 
        tuesday: '火曜日', 
        wednesday: '水曜日',  
        thursday: '木曜日',
        friday:  '金曜日',     
        saturday: '土曜日',   
        sunday: '日曜日',    
        hours: '時間',
        minutes: '分',
        cronExpression: 'カレンダー表達式',
        switchCycle: 'スイッチをトグルします(周期)', // Corrected spelling from '切换'
        switchCron: 'スイッチをトグルします(カレンダー表示式)', // Corrected spelling from '切换'
        placeholder: 'Cronのエクスプレッションをご入力ください(例:0 0 * * 1-7)',
    },
    type: {
        scheduled: '計画されたトリガー型',
    }
}

I've checked through all keys and values to ensure consistency between English and Japanese translations while correcting any errors.

Additionally, if you need further optimizations or modifications such as adding more locales or improving existing ones, please let me know!

@zhanweizhang7 zhanweizhang7 merged commit 72b65ae into v2 Mar 10, 2026
3 of 4 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@feat_locales branch March 10, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants