ontime icon indicating copy to clipboard operation
ontime copied to clipboard

Translation pt br

Open Cicatelli opened this issue 1 year ago • 4 comments

Added Brazilian Portuguese language to the translation system and added translator codes to the operator view

Adicionado ao sistema de tradução o idioma português brasileiro e adicionado códigos do tradutor a visualização do operador

Cicatelli avatar Oct 03 '24 15:10 Cicatelli

Walkthrough

This pull request introduces localization enhancements across multiple components, including MessageControl, TimerControlsPreview, AuxTimer, and others. It integrates the useTranslation hook to replace hardcoded strings with localized versions using the getLocalizedString function. Additionally, new key-value pairs are added to the German translation file, expanding the internationalization capabilities of the application.

Changes

File Path Change Summary
apps/client/src/features/control/message/MessageControl.tsx Added useTranslation import and replaced hardcoded strings in TimerMessageInput and ExternalInput with localized versions.
apps/client/src/features/control/message/TimerViewControl.tsx Added useTranslation import and replaced hardcoded button labels in TimerControlsPreview with localized versions.
apps/client/src/features/control/playback/aux-timer/AuxTimer.tsx Added useTranslation import and replaced the static label "Auxiliary Timer" with a localized string.
apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx Added useTranslation import and replaced hardcoded labels "Started at" and "Expect end" with localized strings.
apps/client/src/features/overview/Overview.tsx Added useTranslation import and replaced hardcoded labels in several overview components with localized strings.
apps/client/src/features/rundown/event-block/EventBlock.utils.ts Added useTranslation import and modified formatOverlap to return a localized string instead of a hardcoded one.
apps/client/src/features/rundown/event-block/EventBlockInner.tsx Added useTranslation import and replaced static text for "UP NEXT" with a localized string.
apps/client/src/features/rundown/event-editor/EventEditor.tsx Added useTranslation import and replaced hardcoded labels with localized versions for "Custom Fields" and "Manage".
apps/client/src/features/rundown/event-editor/composite/EventEditorTimes.tsx Added useTranslation import and replaced hardcoded labels for various fields with localized strings.
apps/client/src/features/rundown/event-editor/composite/EventEditorTitles.tsx Added useTranslation import and replaced static labels for input fields with localized versions.
apps/client/src/features/rundown/quick-add-block/QuickAddBlock.tsx Added useTranslation import and replaced button labels with localized strings.
apps/client/src/features/rundown/rundown-header/RundownHeader.tsx Added useTranslation import and replaced static button labels with localized versions.
apps/client/src/features/rundown/rundown-header/RundownMenu.tsx Added useTranslation import and replaced various static strings with localized versions.
apps/client/src/translation/languages/de.ts Added multiple new key-value pairs for localization, including terms related to timers and editors.

Possibly related PRs

  • #1131: The changes in this PR introduce localization support for the Timeline component, which is related to the main PR's focus on enhancing internationalization capabilities in various components, including MessageControl. Both PRs involve the integration of the useTranslation hook and the getLocalizedString function to replace hardcoded strings with localized versions.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Oct 03 '24 15:10 coderabbitai[bot]

Hi @Cicatelli, thank you for your work here

You did not ask for a review, but from your inactivity I assume that you are finished with the code you are proposing to merge

Unfortunately we cannot consider merging the PR in the current state. The current code mixes two proposals

  • creating a brazilian portuguese translation
  • moving the entire application to being translated

The first one is completely fine, and we could isolate the change and merge without issues. I currently did not see that much difference between the existing portuguese and would be more inclined to revise the existing portuguese translation

As for the second, this is something that we would need to discuss as it is a major project change.

It currently achieves so at the cost of every other translatio being unimplemented.

It also commits us to maintain translations for the entire interface This means that: every time we want to add a feature, tweaks some text or label, we would need to look for translations in all the languages users have requested.

This is not sustainable and likely something we dont want to do.

The current decision is that the signage views are localisable, while the production views are always in english. Changes to this principle would need to be properly investigated and likely supported by a group of users who could provide translations on demand

I hope this does not discourage your contribution and is taken in the way that is meant. In short: If you would extract the translation changes, those can easily be reviewed. The remaining changes need to be discussed

cpvalente avatar Oct 09 '24 18:10 cpvalente

Hi @cpvalente!

The changes presented were a personal need and I made them available since a complete translation of the interfaces could help other people. I understand the big change to implement translation variables for the entire code.

I did not close the translation variables in the entire code, only for the EDITOR view. There is still a lot to do in the other views, however, due to work I have not been able to continue yet...

Regarding the PT vs PT-BR language, there are some terms that sound strange due to cultural differences, and just to avoid changing a language that already exists in the system, I decided to create another one.

I would like to thank you for the excellent work you have been doing with this code, which has helped me a lot!

I hope that within the scope of my knowledge, I can help the growth of a system that has helped me so much. I know little about high-level programming, my area is electrical engineering, the little I know about JS is as a hobby.

Cicatelli avatar Oct 10 '24 12:10 Cicatelli

Hi @Cicatelli , thank you for this.

I appreciate your involvement and your help. If you want to make a separate PR for the the PT-BR translation we can look into it

Meanwhile, if you would like to contribute just reach out and we can find a task that aligns with the roadmap. A good first start would be to evaluate how you use Ontime in your workflow and where is there friction that we could remove

The easiest way to reach out is likely on discord

cpvalente avatar Oct 20 '24 08:10 cpvalente

Hi, I will close this PR for now If you want to create a smaller one tweaking the text it would be welcome

cpvalente avatar Jan 19 '25 19:01 cpvalente