0

I am trying to translate a text thats inside a map field. enter image description here

This is how the collection is set up. I want to translate the "Text" field.

enter image description here

I tried "test.textDoc.*.text", but "dot notion" doesn't seem to work. I even tried "test/textDoc/{random}/text".

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

0

For the Translate Text extension to work, the text to translate has to be in a known, fixed field in your document. In our example, that'd be ocnuwen.text, but the ocnuwen cannot be variable.

Keep in mind that Firebase Extensions are open-source, so you can use the source code of that extension as a template for your own - and tweak it to your needs.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thank you for your response! Could you point me to a tutorial or a doc that shows how to do this? I have being searching, but I can't seem to find any. I am using firestore Web version 9 in my React app. – Hamaad Fahim Jan 19 '23 at 17:19
  • You mean, how to take the code that I linked and modify it? There's very little specific to Firebase in that process, it's pretty similar to forking any other repo. – Frank van Puffelen Jan 20 '23 at 11:53