PocketByte / LocoLaser

Localization tool to import localized strings from external source to your project.
Apache License 2.0
31 stars 1 forks source link

Source that is NOT google sheet? #12

Closed mgj closed 3 years ago

mgj commented 4 years ago

The docs ( https://github.com/PocketByte/LocoLaser/blob/master/docs/config.md ) says that:

"source" : (String, JSON object or Array of Strings and JSON objects)

which makes it seem like it might be possible to use a local file (e.g. a local json file) as the source.

But further down it seems like you can only use Google Sheets as the source? I would like to use a local file instead, i dont care if its JSON or another format. Is this possible? If it is possible is there any example of the structure of a local source file (preferably with multiple locales)?

Thanks in advance

KamiSempai commented 4 years ago

The Source could be anything, but it should be implemented. For now only Google Sheets is implemented.

In the future I'm planning to unify Source and Platform, so any Platform can be used as a Source. But it's not implemented yet.

If you would to use one of the Platform resources as a some sort of Source, for now you could add this Platform in the end of the platforms list in the Config file. For example in following example https://github.com/PocketByte/locolaser-kotlin-mpp-example/blob/master/common/localize_config.json JSON strings has highest priority cause JSON platform placed after Android and iOS platforms. Kotlin platforms are write only, so they will not return any strings in reading and will not be count in resource merge.

mgj commented 4 years ago

Thank you for your response.

I see. I have used the config that you linked, and it works well - It correctly generates the resource files for the other platforms as well as the relevant repositories. But it does not seem to work if you actually localize languages? I have tried using both the "json" and the "android" type with multiple languages but only the base "en" is ever generated...?

KamiSempai commented 4 years ago

Hmm. That's right. Now I see the problem. I will implement the way to provide list of supported locales. Also I thinking about implementation of the way to use automatically recognition of locales. Probably I will implement it in the same release.

But first of all I would to finish issue #11 . It almost done.

mgj commented 4 years ago

That would be very useful to me at least :) Thanks for confirming, and thanks for the work you've done with LocoLaser. For what its worth, the googlesheet source feature works well but yeah... alternatives would be nice. Looking forward to the next release

I dont think i have anything else to add, feel free to close this issue if you want

KamiSempai commented 3 years ago

Now, from the version 2.0.0, there is no difference between platform and source. Also you can and should provide the list of locales in config. More information you can find in migration guide https://github.com/PocketByte/LocoLaser/blob/master/docs/migration.md

Automatic recognition of locales not yet implemented.