Closed RappyTV closed 9 months ago
Yeah this is a "feature" that I added recently but after using it (and having a bunch of bug report internally 😄 ) I think it was a mistake. The CLI should only sync what matches in the files
config. It will be fix in the next CLI release.
is there an ETA for that?
I want to test locally and merge https://github.com/mirego/accent/pull/404 before doing the release. My goal is this week 😃
okay thanks a lot :D
Done! 0.16.0 has been published to npm
But how would I now only fetch the addon
translation? Do I have to pass a parameter or some property in the accent.json?
But how would I now only fetch the
addon
translation? Do I have to pass a parameter or some property in the accent.json?
@simonprev please I need help with this. i think you misunderstood my original issue
If you only want 1 file to sync in this project, you can remove the "wildcard" match in the config:
{
"apiUrl": "--",
"files": [
{
"namePattern": "parentDirectory",
"format": "json",
"source": "locales/addon.json",
"target": "locales/%slug%.json"
}
]
}
The source will only be "addon.json" and it will ignore the rest of the files uploaded in your Accent project.
If you only want 1 file to sync in this project, you can remove the "wildcard" match in the config:
{ "apiUrl": "--", "files": [ { "namePattern": "parentDirectory", "format": "json", "source": "locales/addon.json", "target": "locales/%slug%.json" } ] }
The source will only be "addon.json" and it will ignore the rest of the files uploaded in your Accent project.
Well I tried it but it always pulls the api.json
regardless of what I put into the source value. The CLI also always returns that it pulled the api.json:
Fetch config in accent.json... API Client ✓
Syncing sources → en_us ✓
Adding translations paths → de_de ✓
Writing files locally
↓ locales/en_us.json api → en_us
↓ locales/de_de.json api → de_de
For more informations on operations: https://www.accent.reviews/guides/glossary.html#sync
Syncing took 2145 milliseconds, completed without issues
So it's practically impossible for me to pull the addon.json
If you only want 1 file to sync in this project, you can remove the "wildcard" match in the config:
{ "apiUrl": "--", "files": [ { "namePattern": "parentDirectory", "format": "json", "source": "locales/addon.json", "target": "locales/%slug%.json" } ] }
The source will only be "addon.json" and it will ignore the rest of the files uploaded in your Accent project.
Well I tried it but it always pulls the
api.json
regardless of what I put into the source value. The CLI also always returns that it pulled the api.json:Fetch config in accent.json... API Client ✓ Syncing sources → en_us ✓ Adding translations paths → de_de ✓ Writing files locally ↓ locales/en_us.json api → en_us ↓ locales/de_de.json api → de_de For more informations on operations: https://www.accent.reviews/guides/glossary.html#sync Syncing took 2145 milliseconds, completed without issues
So it's practically impossible for me to pull the
addon.json
@simonprev
I have this
accent.json
:and I have 2 files in my accent -
addon
andapi
. But in this program (the API) I only need to use theapi
file and in the other one I only want to use the addon file. It would be pretty awesome to have a keyfile
in theaccent.json
which then only syncs a specific file. That would also make sense because thefiles
is an array...I understand that I could just create a second project but this would look pretty unorganized in my opinion.