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

[Feat] Support CSV for Common Translations #67

Open
Sherlouk opened this issue Dec 3, 2022 · 2 comments
Open

[Feat] Support CSV for Common Translations #67

Sherlouk opened this issue Dec 3, 2022 · 2 comments
Assignees
Labels
Feature Request New functionality the app doesn't provide yet Size: Medium Probably less than 1 month of work

Comments

@Sherlouk
Copy link

Sherlouk commented Dec 3, 2022

Problem Statement

As an extension to #55, it would be nice if as a user I can upload a CSV of translations which are then cached (on device) by ReMafoX. These CSVs can then be used to lookup common translations should they be needed in any of my projects.

For example, https://stefangabos.github.io/world_countries/ is a resource which provides CSV translations of all countries in the world into many languages. It doesn't make sense to bake all of this into ReMafoX, but as a developer who creates many apps/projects using these values it could be handy to have at hand.

Additionally there's a large resource managed by the Welsh government (https://github.com/cwd24/termcymru) which translates many common English words and phrases into Welsh. This would be a helpful resource for many of my applications which provide Welsh support, but again doesn't make sense for ReMafoX to have baked in support for.

Suggested Solution

A new page should be added to the global ReMafoX preferences page. This allows you to upload (by drag and drop or through a 'Browse' button) a CSV file.

ReMafoX should parse the first line (headers) and provide a simple mapping utility. There are two columns of relevance: the source string, and the destination string. Other columns should be ignored. I suspect ReMafoX would then need to ask what the languages are (from a dropdown of known/supported languages).

The full CSV file should be stored on the local device in a central cache folder.

Additional Considerations

The main complexity here simply comes from the fact that every CSV could be in a different format and so we need to create a mapping utility to define the source and destination columns.

If we wanted to do a simpler MVP version, we could enforce that there is only two columns where the first is source and second is destination. This would just require us to use a separate tool to modify the CSV before uploading - but that's not terrible!

@Jeehut
Copy link
Member

Jeehut commented Dec 3, 2022

@Sherlouk Thank you for this detailed and considerate feature request!

I think it totally does make sense to "bake in" a larger set of common translations, I would consider that even part of #55. So if you are aware of any sources that have a larger set of data that could be translated, feel free to provide them there. The translations of all countries names you gave isn't such an example though, both because it's just a small amount of data and (more importantly) it doesn't really add much value given that machine translation probably is pretty good in translating names of countries as the meaning should not change based on context.

Having that said, what you suggest here totally makes sense to provide users with a more flexible option. On top of CSV, also JSON and XML could be added here as supported file formats. I don't think it's necessary to restrict the CSF file to those with two columns, if I parse a CSV file already I can also easily skip a few columns, so users would just need to specify the column index, basically and if there's a header line or not (which I would ignore, too if there was one). For JSON and XML I'd probably use something like a simplified form of an XPath, but I'll figure something out. CSV might be the MVP here.

@Jeehut Jeehut added Feature Request New functionality the app doesn't provide yet Size: Medium Probably less than 1 month of work labels Dec 3, 2022
@Sherlouk
Copy link
Author

Sherlouk commented Dec 3, 2022

Aye it would make sense to bake in some translations for sure, but might be hard to find a cohesive dataset that is also representative of the type of content that would be used in mobile apps (things like Close, Share, Home, Settings etc).

@Jeehut Jeehut self-assigned this Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New functionality the app doesn't provide yet Size: Medium Probably less than 1 month of work
Projects
None yet
Development

No branches or pull requests

2 participants