feat: added russian translations for WearOS
This commit is contained in:
@@ -12,9 +12,11 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.wear.compose.foundation.lazy.TransformingLazyColumn
|
import androidx.wear.compose.foundation.lazy.TransformingLazyColumn
|
||||||
import androidx.wear.compose.material3.Text
|
import androidx.wear.compose.material3.Text
|
||||||
|
import ru.omni_devel.cards.R
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
private lateinit var db: DbHelper
|
private lateinit var db: DbHelper
|
||||||
@@ -41,7 +43,7 @@ fun App(cards: List<CardInfo>) {
|
|||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Text("Sync with mobile APP to get started")
|
Text(stringResource(R.string.sync_with_mobile_app_to_get_started))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TransformingLazyColumn(
|
TransformingLazyColumn(
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.widget.Toast
|
|||||||
import com.google.android.gms.wearable.MessageEvent
|
import com.google.android.gms.wearable.MessageEvent
|
||||||
import com.google.android.gms.wearable.WearableListenerService
|
import com.google.android.gms.wearable.WearableListenerService
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
import ru.omni_devel.cards.R
|
||||||
|
|
||||||
class MessagesReceiver : WearableListenerService() {
|
class MessagesReceiver : WearableListenerService() {
|
||||||
private lateinit var db: DbHelper
|
private lateinit var db: DbHelper
|
||||||
@@ -28,7 +29,7 @@ class MessagesReceiver : WearableListenerService() {
|
|||||||
db.addCards(cards)
|
db.addCards(cards)
|
||||||
|
|
||||||
Handler(Looper.getMainLooper()).post {
|
Handler(Looper.getMainLooper()).post {
|
||||||
Toast.makeText(this, "Database updated!", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, this.getString(R.string.database_updated), Toast.LENGTH_SHORT).show()
|
||||||
|
|
||||||
val intent = Intent(this, MainActivity::class.java).apply {
|
val intent = Intent(this, MainActivity::class.java).apply {
|
||||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||||
|
|||||||
@@ -19,9 +19,11 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.asImageBitmap
|
import androidx.compose.ui.graphics.asImageBitmap
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.wear.compose.material3.MaterialTheme
|
import androidx.wear.compose.material3.MaterialTheme
|
||||||
import androidx.wear.compose.material3.Text
|
import androidx.wear.compose.material3.Text
|
||||||
|
import ru.omni_devel.cards.R
|
||||||
|
|
||||||
class ShowCardActivity : ComponentActivity() {
|
class ShowCardActivity : ComponentActivity() {
|
||||||
private lateinit var db: DbHelper
|
private lateinit var db: DbHelper
|
||||||
@@ -105,7 +107,7 @@ fun ShowCardPage(cardInfo: CardInfo) {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
"Failed to generate code",
|
stringResource(R.string.failed_to_generate_card_code),
|
||||||
color = MaterialTheme.colorScheme.error,
|
color = MaterialTheme.colorScheme.error,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="sync_with_mobile_app_to_get_started">Синхронизируйте с мобильным приложением для начала работы</string>
|
||||||
|
|
||||||
|
<string name="database_updated">База данных обновлена!</string>
|
||||||
|
|
||||||
|
<string name="failed_to_generate_card_code">Не удалось сгенерировать код карты. Проверьте данные</string>
|
||||||
|
</resources>
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">OmniCards</string>
|
<string name="app_name" translatable="false">OmniCards</string>
|
||||||
<string name="hello_world">Hello, %1$s!</string>
|
|
||||||
|
<string name="sync_with_mobile_app_to_get_started">Sync with mobile APP to get started</string>
|
||||||
|
|
||||||
|
<string name="database_updated">Database updated!</string>
|
||||||
|
|
||||||
|
<string name="failed_to_generate_card_code">Failed to generate card code. Check the card data</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user