Skip to content

Commit 8fe6e75

Browse files
committed
docs: consolidate troubleshooting guides and streamline Jetpack usage docs
1 parent f9ec5dd commit 8fe6e75

File tree

3 files changed

+9
-147
lines changed

3 files changed

+9
-147
lines changed

android-sdk/jetpack/troubleshooting.mdx

Lines changed: 0 additions & 97 deletions
This file was deleted.

android-sdk/jetpack/usage.mdx

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you are unsure of which translation type to choose, notice a “Use for...”
2323

2424
## Getting translations
2525

26-
### 1. Simple Strings
26+
### Simple Strings
2727

2828
- **Jetpack Compose**
2929

@@ -49,7 +49,7 @@ In the Compose Multiplatform use `stringResource` function with `Res`.
4949

5050
Use `stringResource` for **simple strings** (e. g., error messages, titles), retrieve a translation by its resource ID.
5151

52-
### 2. With Parameters
52+
### With Parameters
5353

5454
Pass parameters to translations, supply arguments for placeholders in your keys.
5555

@@ -73,47 +73,7 @@ fun TextWithParameters(name: String) {
7373

7474
Use for translation with **dynamic values**. Add data that changes during the app's runtime (e.g., dates, numbers, usernames).
7575

76-
### Formatter Configuration
77-
78-
**Choose how placeholders are parsed and rendered.**
79-
Use when you have translations with placeholders, SDK must know how to exchange the placeholders for wanted values.
80-
**Example**: "`Hello %s`" or"`You have {count} items`"
81-
82-
See also: [Android XML format](/platform/formats/android_xml) · [Tolgee Universal ICU placeholders](/platform/translation_process/tolgee_universal_icu_placeholders)
83-
84-
85-
**1. Sprintf**
86-
87-
```kotlin
88-
Tolgee.init {
89-
contentDelivery {
90-
url = "https://cdn.tolg.ee/your-cdn-url-prefix"
91-
format(Tolgee.Formatter.Sprintf)
92-
}
93-
}
94-
```
95-
96-
**Use for easy scenarios**, when you are using formatters, like `%s, %d, %1$s`.
97-
98-
:::warning
99-
**This parameter type won't work with fallbacks to Android Resources** - it's not functional for apps with any offline activity.
100-
:::
101-
102-
**2. ICU**
103-
104-
```kotlin
105-
Tolgee.init {
106-
contentDelivery {
107-
url = "https://cdn.tolg.ee/your-cdn-url-prefix"
108-
format(Tolgee.Formatter.ICU)
109-
}
110-
}
111-
```
112-
113-
**Use for more advanced translations and ICU features**, when you need nested formats or formatters,
114-
like e.g. few, may, female, and complex lingual principles.
115-
116-
### 3. Plurals
76+
### Plurals
11777

11878
Handle plurals with `pluralStringResource` - provide the count and any formatting arguments.
11979

@@ -220,15 +180,15 @@ Handy for **observing locale changes** in real time, **keeping track of current
220180

221181
Tolgee's Compose integration offers several advantages over traditional Android Views:
222182

223-
1. **Reactive by default** - Compose UI automatically updates when translations change, without manual intervention
183+
**Reactive by default** - Compose UI automatically updates when translations change, without manual intervention
224184

225-
2. **No Activity recreation needed** - Unlike Android Views which require `recreate()` to refresh translations
185+
**No Activity recreation needed** - Unlike Android Views which require `recreate()` to refresh translations
226186

227-
3. **Simplified API** - Familiar `stringResource()` and `pluralStringResource()` functions that match Compose's built-in functions
187+
**Simplified API** - Familiar `stringResource()` and `pluralStringResource()` functions that match Compose's built-in functions
228188

229-
4. **State-based** - Translations are part of the Compose state system, ensuring proper recomposition
189+
**State-based** - Translations are part of the Compose state system, ensuring proper recomposition
230190

231-
5. **Multiplatform support** - Works with both Jetpack Compose for Android and Compose Multiplatform
191+
**Multiplatform support** - Works with both Jetpack Compose for Android and Compose Multiplatform
232192

233193
## Example Projects
234194

@@ -240,5 +200,5 @@ For complete examples of how to use the Tolgee Compose module, check out the dem
240200
## Next Steps
241201

242202
- **Using traditional Views?** See [Android Views Usage](../usage.mdx)
243-
- **Having issues?** Check [Troubleshooting](./troubleshooting.mdx)
203+
- **Having issues?** Check [Troubleshooting](../troubleshooting.mdx)
244204
- **Need example apps?** See [Example Apps](../example-apps.mdx)

sidebarAndroidSdk.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module.exports = {
99
label: 'Jetpack Compose',
1010
items: [
1111
'jetpack/usage',
12-
'jetpack/troubleshooting',
1312
],
1413
},
1514
'example-apps',

0 commit comments

Comments
 (0)