-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
129 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<resources> | ||
<string name="app_name">SaltUI</string> | ||
<string name="confirm">确认(字符串替换测试)</string> | ||
</resources> |
39 changes: 39 additions & 0 deletions
39
ui2/src/androidMain/kotlin/com/moriafly/salt/ui/internal/StringResource.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* SaltUI | ||
* Copyright (C) 2024 Moriafly | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@file:Suppress("UNUSED") | ||
|
||
package com.moriafly.salt.ui.internal | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.res.stringResource | ||
import com.moriafly.salt.ui.R | ||
|
||
@Composable | ||
internal actual fun stringResourceBack(): String { | ||
return stringResource(R.string.back) | ||
} | ||
|
||
@Composable | ||
internal actual fun stringResourceCancel(): String { | ||
return stringResource(R.string.cancel) | ||
} | ||
|
||
@Composable | ||
internal actual fun stringResourceConfirm(): String { | ||
return stringResource(R.string.confirm) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="back">Back</string> | ||
<string name="cancel">Cancel</string> | ||
<string name="confirm">Confirm</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ui2/src/commonMain/kotlin/com/moriafly/salt/ui/internal/StringResource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* SaltUI | ||
* Copyright (C) 2024 Moriafly | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@file:Suppress("UNUSED") | ||
|
||
package com.moriafly.salt.ui.internal | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
internal expect fun stringResourceBack(): String | ||
|
||
@Composable | ||
internal expect fun stringResourceCancel(): String | ||
|
||
@Composable | ||
internal expect fun stringResourceConfirm(): String |
42 changes: 42 additions & 0 deletions
42
ui2/src/desktopMain/kotlin/com/moriafly/salt/ui/internal/StringResource.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* SaltUI | ||
* Copyright (C) 2024 Moriafly | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@file:Suppress("UNUSED") | ||
|
||
package com.moriafly.salt.ui.internal | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.jetbrains.compose.resources.stringResource | ||
import saltui.ui2.generated.resources.Res | ||
import saltui.ui2.generated.resources.back | ||
import saltui.ui2.generated.resources.cancel | ||
import saltui.ui2.generated.resources.confirm | ||
|
||
@Composable | ||
internal actual fun stringResourceBack(): String { | ||
return stringResource(Res.string.back) | ||
} | ||
|
||
@Composable | ||
internal actual fun stringResourceCancel(): String { | ||
return stringResource(Res.string.cancel) | ||
} | ||
|
||
@Composable | ||
internal actual fun stringResourceConfirm(): String { | ||
return stringResource(Res.string.confirm) | ||
} |