<commit_before>The Mod will automatically translate messages in the format:
`{"message": "Your message contents go here."}`

created under the path: `${param:TRIGGER_PATH}/languageID`, where languageID is the ISO-639-1 code.
A list of valid languages and their corresponding codes can be found in the
[Cloud Translate official documentation](https://cloud.google.com/translate/docs/languages).

To trigger the mod, write messages to the database path at:
`${param:TRIGGER_PATH}/{languageID}/{messageId}` via one of the [official Firebase SDKs](https://firebase.google.com/docs/database/). The message should be a JSON
resembling the following: `{"message": "Your message goes here."}`.

To try out this mod right away, run the following commands via the Firebase CLI:

```
firebase database:push /${param:TRIGGER_PATH}/en --data '{"message": "I like to eat cake"}'
firebase database:push /${param:TRIGGER_PATH}/en --data '{"message": "Good morning! Good night."}'
```<commit_msg>wordsmith & clarify POSTINSTALL (rtdb-translate)<commit_after>### See it in action

To test out this extension, run the following commands using the Firebase CLI:

```
firebase database:push /${param:TRIGGER_PATH}/en --data '{"string": "I like to eat cake"}'
firebase database:push /${param:TRIGGER_PATH}/en --data '{"string": "Good morning! Good night."}'
```

When you go to the [Realtime Database tab](https://console.firebase.google.com/project/${param:PROJECT_ID}/database/${param:PROJECT_ID}/data), you'll see your database populated with both the original strings and the translated strings, with a data structure similar to:

```
/${param:PROJECT_ID}
   /${param:TRIGGER_PATH}
       /en
           /<stringID-1234>
               "string": "https://google.com",
           /<stringID-4321>
               "string": "Good morning! Good night.",
       /<targetLanguageCode>
           /<stringID-1234>
               "string": "<translated-text-about-cake>",
           /<stringID-4321>
               "string": "<translated-text-about-greetings>",
```

### Use this extension

To trigger this extension, write strings to the database path: `${param:TRIGGER_PATH}/{sourceLanguageID}/{messageId}`. You can use any of the [Firebase Realtime Database SDKs](https://firebase.google.com/docs/database/). When triggered, the extension translates the string then writes the translated strings under new nodes within the same database path: `${param:TRIGGER_PATH}/{targetLanguageID}/{messageId}`.

The original, untranslated string must be a JSON resembling the following: `{"string": "This is your original, untranslated text."}`.

You specify the source language (and the target languages) using ISO-639-1 codes. You can find a list of valid languages and their corresponding codes in the [Cloud Translate API documentation](https://cloud.google.com/translate/docs/languages). The following are your configured desired target language(s): `${param:LANGUAGES}`.

If the original string in `${param:TRIGGER_PATH}/{sourceLanguageID}/{messageId}` is updated, then the translated strings will be automatically updated, too.

### Monitoring

As a best practice, you can [monitor the activity](https://firebase.google.com/docs/extensions/manage-installed-extensions#monitor) of your installed extension, including checks on its health, usage, and logs.
{'fraction_non_alphanumeric': 0.12297053517739026, 'fraction_numerical': 0.0072158749248346366, 'mean_word_length': 4.545, 'pattern_counts': {'":': 11, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5814448', 'n_tokens_mistral': 932, 'n_tokens_neox': 897, 'n_words': 339}