Skip to content
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

Translation Contributions: Help Us Translate DiaryVault into Your Language #212

Open
SankethBK opened this issue Sep 30, 2024 · 5 comments
Labels
good first issue Good for newcomers ready for development There is a clear solution which can be implemented

Comments

@SankethBK
Copy link
Owner

SankethBK commented Sep 30, 2024

Steps to Add a New Language Translation

  1. Get the Language Code:

  2. Create a .arb File:

    • Navigate to the lib/l10n/ directory in the project.
    • Create a new .arb file named intl_<language_code>.arb.
      • For example, if you are contributing Spanish translations, your filename would be intl_es.arb.

Note: Only make changes in .arb files. Files inside generated/intl folder are autogenerated by Flutter Intls Vscode extension.

  1. Translate Messages:

    • Use the template file intl_en.arb as a reference.
    • Inside this file, you will find key-value pairs where the keys should remain the same.
    • Translate the corresponding values into your target language in your new .arb file.
      • Example:
        • In intl_en.arb:
          {
            "enterNewEmail": "Enter new email"
          }
        • In intl_es.arb:
          {
               "enterNewEmail": "Introduce un nuevo correo electrónico",
          }
  2. Install Flutter Intl Extension:

    • Install the Flutter Intl extension for Visual Studio Code.
    • This extension helps with generating boilerplate code and keeps localization files in sync.
  3. Regenerate Localization Files:

    • If you're using the Flutter Intl Vscode extension, it should automatically generate the necessary files.
  4. Test Your Translations:

    • Run the app and change the device or emulator language to your target language.
    • Verify that all translations appear correctly in the app.
  5. Submit a Pull Request:

    • Commit your changes and push them to your forked repository.
    • Submit a pull request to the main repository for review.

Additional Notes

  • Consistency: Ensure that you maintain the same placeholders and variables used in the English template. For example, if there are variables like {userName}, they should be included exactly as is in your translations.
  • Singular and Plural nouns: Be careful in handling cases where singular and plural have different wordings. For eg: You are deleting 1 note and You are deleting 3 notes, while in English the difference is just adding s for plural, it may be complex for other languages.
  • Collaboration: If you're unsure about a translation, consider discussing it with native speakers or opening an issue for community input.
@SankethBK SankethBK added good first issue Good for newcomers ready for development There is a clear solution which can be implemented labels Sep 30, 2024
@SankethBK SankethBK pinned this issue Sep 30, 2024
@rsg-devghost
Copy link
Contributor

Hey @SankethBK , would like to contribute on this issue.

@SankethBK
Copy link
Owner Author

@rsg-devghost yes, please go ahead. Just mention what you'll be contributing to avoid conflict

@rsg-devghost
Copy link
Contributor

Sure, just a simple doubt , are some of the language translations incomplete?. If so i would like to complete, "Kannada - kn" for instance. Also I would like to add 2 languages "Russian - ru" and "Bengali Bangla - bn".

@SankethBK
Copy link
Owner Author

Yes, most of them are incomplete.

@rsg-devghost
Copy link
Contributor

No problem, I'll do the Kannada translations, and add both Russian and Bengali languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ready for development There is a clear solution which can be implemented
Projects
None yet
Development

No branches or pull requests

2 participants