robisim74 / qwik-speak

Translate your Qwik apps into any language
https://robisim74.gitbook.io/qwik-speak/
MIT License
131 stars 15 forks source link

Does qwik-speak-extract takes into account arrays? #103

Closed fprl closed 9 months ago

fprl commented 9 months ago

Hi again,

One question, is it possible to make qwik-speak-extract to take arrays into account? for example consider this home.json file:

{
  "home": {
    "faq": {
      "title": "Frequently Asked Questions",
      "faqs": [
        {"question": "", "answer": ""},
        {"question": "", "answer": ""},
       ],
     }
   }
 }
// component
const faqs = t<{ question: string; answer: string }[]>('home.faq.faqs')

Then I run "qwik-speak-extract": "qwik-speak-extract --supportedLangs=nl,en,de,fr,it --assetsPath=./src/i18n",

The JSON gets overwritten and now home.faq.faqs is a string.

Thank you

robisim74 commented 9 months ago

Thanks for reporting. That's a bug.

robisim74 commented 8 months ago

@fprl Should be fixed in https://github.com/robisim74/qwik-speak/releases/tag/v0.19.0

fprl commented 8 months ago

@robisim74 Thanks a lot, It's working now!