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

[Bug]: files created by create_translation_file not found when creating new translator #137

Open
1 task done
see24 opened this issue Sep 6, 2024 · 0 comments
Open
1 task done
Labels

Comments

@see24
Copy link

see24 commented Sep 6, 2024

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

0.3.0

Platform and OS Version

Windows 11

Existing Issues

No response

What happened?

The default output file name for create_translation_file and the RStudio addin for csv output is "translate_lang.csv" which I expected I would just need to add the language to eg "translate_fr.csv" and change the "key" in the first column to "en" and "lang" in the second column to "fr", fill in the translations and it would work. But I got an error that "Key translation is not the same in all files.". This was missleading since the keys were not part of the problem

Steps to reproduce

  1. Using the basic example app
    create_translation_file("examples/basic/app_csv.R", type = "csv")
  2. just change "lang" and "key" placeholders and add dummy translations then try to use it
    i18n <- Translator$new(translation_csvs_path = ".")
    Get error: "Key translation is not the same in all files."

Expected behavior

Two things should happen differently:

  1. Output from create_translation_file should be called "translation_lang.csv" so it is more obvious what the right file name is and so it matches json
  2. read_and_merge_csvs should have a check for length(all_files) == 0 and give an informative error that no files were found matching the pattern "translation_.*[.]csv" See this line

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

@see24 see24 added the bug label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant