mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Make :core:strings a Compose Multiplatform library (#3617)
This commit is contained in:
parent
d7fff4add2
commit
28590bfcdf
206 changed files with 1722 additions and 470 deletions
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.meshtastic.core.strings
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.jetbrains.compose.resources.StringResource
|
||||
|
||||
fun Context.getString(stringResource: StringResource): String = runBlocking {
|
||||
org.jetbrains.compose.resources.getString(stringResource)
|
||||
}
|
||||
|
||||
fun Context.getString(stringResource: StringResource, vararg formatArgs: Any): String = runBlocking {
|
||||
org.jetbrains.compose.resources.getString(stringResource, *formatArgs)
|
||||
}
|
||||
|
||||
fun Resources.getString(stringResource: StringResource): String = runBlocking {
|
||||
org.jetbrains.compose.resources.getString(stringResource)
|
||||
}
|
||||
|
||||
fun Resources.getString(stringResource: StringResource, vararg formatArgs: Any): String = runBlocking {
|
||||
org.jetbrains.compose.resources.getString(stringResource, *formatArgs)
|
||||
}
|
||||
|
|
@ -22,7 +22,6 @@
|
|||
<string name="zh_CN" translatable="false">简体中文</string>
|
||||
<string name="zh_TW" translatable="false">繁體中文</string>
|
||||
|
||||
<string name="app_name" translatable="false">Meshtastic</string>
|
||||
<string name="some_username" translatable="false">SKH</string>
|
||||
<string name="sample_message" translatable="false">hey I found the cache, it is over here next to the big tiger. I\'m kinda scared.</string>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue