Chanjung Kim
877fbcc2b0
Fallback to `other` pluralization when the right one not found
8 months ago
Chanjung Kim
7f3db17c1c
Rename properties of GeneratePluralRuleListsTask
8 months ago
Konstantin Tskhovrebov
bb419dd1e5
[resources] Add autogenerated plural rules under git tracking
8 months ago
Chanjung Kim
5df675ef35
Add pluralization condition optimization
8 months ago
Chanjung Kim
95f7314f62
Share PluralRuleList with languages with the same rule
8 months ago
Chanjung Kim
700393edf2
Rename QuantityStringResource to PluralStringResource for consistency
8 months ago
Chanjung Kim
864237e89c
Remove redundant comments
8 months ago
Chanjung Kim
b341df41e2
Add more tests for pluralization
8 months ago
Chanjung Kim
6570cd3e08
Parse without using String.split
8 months ago
Chanjung Kim
d0eea88e2b
Add unit tests for pluralization rules
8 months ago
Chanjung Kim
c2ca9488e5
Fix LDML range parsing
8 months ago
Chanjung Kim
7413a2249e
Determine PluralCategory by current environment
8 months ago
Chanjung Kim
656872aadb
Generate Kotlin arrays containing pluralization rules during build
8 months ago
Chanjung Kim
a9904faf64
Copy plurals.xml from Unicode CLDR
8 months ago
Chanjung Kim
5a3a9747ac
feat: Add QuantityStringResource and pluralStringResource
8 months ago
Konstantin
6f3eb08488
[resources] Fix readResourceBytes function on Android if font is located under qualified directory ( #4512 )
...
Fix the problem when users try to read a font bytes under a qualified
directory.
8 months ago
Konstantin
ad9c898651
[resources] Use first of preferred locales instead of a current on iOS ( #4507 )
...
There is a bug on iOS:
```
NSLocale.currentLocale() -> 'en-US'
NSLocale.preferredLanguages().first().let { NSLocale(it as String) } -> 'ru'
```
An equal result was expected!
the first method was used in a non-compose code and another one in the
compose code.
The PR fixes behavior in a non-compose environment.
8 months ago
Konstantin
e8459e19b4
[resources] Fix regionCode crash on iOS before 17 ( #4473 )
...
The regionCode API
```
NSLocale.currentLocale().regionCode
```
was published in iOS 17:
https://developer.apple.com/documentation/foundation/nslocale/4172868-regioncode?language=objc
to make it works on all iOS versions we have to use:
```
NSLocale.currentLocale().objectForKey(NSLocaleCountryCode) as? String
```
fixes https://github.com/JetBrains/compose-multiplatform/issues/4469
9 months ago
Konstantin
e7f1a6cc20
[resources] Fix regionCode crash on iOS before 17 ( #4473 )
...
The regionCode API
```
NSLocale.currentLocale().regionCode
```
was published in iOS 17:
https://developer.apple.com/documentation/foundation/nslocale/4172868-regioncode?language=objc
to make it works on all iOS versions we have to use:
```
NSLocale.currentLocale().objectForKey(NSLocaleCountryCode) as? String
```
fixes https://github.com/JetBrains/compose-multiplatform/issues/4469
9 months ago
Luca Spinazzola
4c238f5ff8
update macOS readResourceBytes to use composeResources ( #4458 )
...
Loading resources in the demo is broken without updating this to use
`composeResources`
9 months ago
Igor Demin
e14bf1c072
Resources. Don't return a cached value when pass new args ( #4333 )
...
The issue was because we cache the value in the current composition, and
the next composition returns the cached value.
There weren't an issue if we just call one `stringResource` after
another because those are different compositions.
Fixes https://github.com/JetBrains/compose-multiplatform/issues/4325
9 months ago
Igor Demin
4e948e4bc3
Resources. Don't return a cached value when pass new args.
...
The issue was because we cache the value in the current composition, and the next composition returns the cached value.
There weren't an issue if we just call one `stringResource` after another because those are different compositions.
Fixes https://github.com/JetBrains/compose-multiplatform/issues/4325
9 months ago
Konstantin
fbf5dbe20f
Fix fonts duplication in android app. ( #4284 )
10 months ago
Oleksandr Karpovich
c4bc761b0d
Gradle Plugin: Force kotlinx-coroutines version 1.8.0-RC2 for web targets in user projects ( #4278 )
...
Removed such the version substituion from the resources library. The
versions will be subtituted now by gradle plugin.
10 months ago
Oleksandr Karpovich
ffea196aa8
Use coroutines 1.7.3 for desktop and native. But use 1.8.0-RC2 for web targets ( #4244 )
10 months ago
Konstantin
870b2d3aec
Improve handling of special characters in string resources ( #4220 )
...
Introduced a function to process and replace certain escaped symbols
like '\n', '\t', and '\uXXXX' in the strings extracted from compose
string resources.
10 months ago
Konstantin
18de77e0bd
Update dependency versions and refactor build configs ( #4215 )
10 months ago
Konstantin Tskhovrebov
4a65b1a1d8
Refactor compose library tests
10 months ago
Konstantin
b4881ffe01
Fix native xml parser and add ios native tests ( #4207 )
...
Co-authored-by: Da Risk <da_risk@geekorum.com>
10 months ago
Konstantin
c31c761e09
Mark all resources public API as experimental. ( #4146 )
...
And all public but only for generated code API as @InternalResourceApi
10 months ago
Konstantin
f405dd8ba0
Delete experimental marker from stable resources APIs ( #4144 )
10 months ago
Konstantin
8955e66eac
Introduce a 'composeResources/files' directory for any files. ( #4079 )
...
Introduce a 'composeResources/files' directory for any files.
11 months ago
Igor Demin
6c4def5bb5
Fix Qualifier density ( #4088 )
...
```
LDPI(120), // 120/160 = 0.75
MDPI(160), // 160/160 = 1.0
HDPI(240), // 240/160 = 1.5
XHDPI(320), // 320/160 = 2.0
XXHDPI(480), // 480/160 = 3.0
XXXHDPI(640); // 640/160 = 4.0
```
11 months ago
Konstantin
8423efc466
Override non-composable function getResourceEnvironment for tests ( #4057 )
11 months ago
Konstantin
4c6bebb237
Add TestComposeEnvironment for resource tests ( #4056 )
11 months ago
Konstantin
27915cbc0f
Get environment and select resource by qualifiers ( #4018 )
11 months ago
Oleksandr Karpovich
382c6a319b
run k/wasm tests in resources library ( #4031 )
...
Co-authored-by: Oleksandr.Karpovich <oleksandr.karpovich@jetbrains.com>
11 months ago
Oleksandr Karpovich
5e999e7b7d
Add K/Wasm target to components/resources library ( #4028 )
...
Changes:
- added k/wasm target to library and demo
- added libs.versions.toml with coroutines version
Tested:
- using demo project
- publishToMavenLocal
I'll setup the test separately.
---------
Co-authored-by: Oleksandr.Karpovich <oleksandr.karpovich@jetbrains.com>
12 months ago
Konstantin
181bfd1612
Resources gradle plugin ( #3961 )
1 year ago
Konstantin
760f3f5b24
Revert "Rename components library modules. ( #3991 )"
1 year ago
Konstantin
12992dceb3
Rename components library modules. ( #3991 )
...
There was a problem with an android publication. Android artifactId has
name "module_name"-"android" even though we explicitly renamed
artifactId inside the configureMavenPublication block. It means that
"components-ui-tooling-preview" android library rewrites
"components-resources" android library on the maven. Because they have
the same name "library-android".
1 year ago
Konstantin
7505624aa0
Use separate cache dispatchers with limited parallelism ( #3929 )
1 year ago
Konstantin
1be81af584
Dispatch image cache manipulation to the cache dispatcher ( #3921 )
1 year ago
Konstantin
5d1eb9a3f5
Support bitmap/vector images, strings, fonts and raw resource loading.
...
Limitation: for a correct work on the android user is supposed to copy a font file to the android asset directory
1 year ago
Konstantin
2692cb320d
Update Kotlin, dependencies and build scripts ( #3835 )
1 year ago
Oleksandr Karpovich
73802292ce
CfW: Allow web resource routing configuration ( #3852 )
...
This commit changes the default resource routing behaviour:
- It used to search for a file in the root directory (on a domain level)
- After this change, it will search for a file relatively to the current
url segment
Besides that, we add a small configuration to let developers change the
default behaviour when needed.
___
usage examples:
```kotlin
// 1
configureWebResources {
setResourceFactory { path -> urlResource("/myApp1/resources/$path") }
}
// 2
configureWebResources {
setResourcelFactory { path -> urlResource("https://mycdn.com/myApp1/res/$path ") }
}
```
___
This will fix https://github.com/JetBrains/compose-multiplatform/issues/3413 (currently it bothers our users)
1 year ago
Igor Demin
a609db563a
Components. Downgrade to Kotlin 1.8.22 ( #3390 )
...
Dowgrading to Kotlin 1.8 will allow to use `components` in Kotlin 1.8 and Kotlin 1.9 projects (iOS, JS targets). Now it is supported only in Kotlin 1.9 projects.
1 year ago
Igor Demin
9f118d39d2
Components. Fix Its usage must be marked with '@kotlinx.cinterop.ExperimentalForeignApi' ( #3383 )
...
* Components. Fix Its usage must be marked with '@kotlinx.cinterop.ExperimentalForeignApi'
https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_Publish_2_AllGitHubRelease/4238435?buildTab=dependencies&mode=list&state=failed&type=snapshot&hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildProblemsSection=true&showLog=4238425_373_267&logFilter=debug&logView=flowAware#4238426
Kotlin 1.9 broke source compatibility for native targets, usePinned is now experimental
* macOs
1 year ago
Igor Demin
06bcb1c680
Components. Fix `KotlinSourceSet with name 'androidTest' not found.` on Kotlin 1.9.0 ( #3375 )
...
FAILURE: Build failed with an exception.
* Where:
Build file '/mnt/agent/work/eef8b9c316a53dd6/components/resources/library/build.gradle.kts' line: 66
`androidTest` was deprecated: https://kotlinlang.org/docs/whatsnew18.html#kotlin-multiplatform-a-new-android-source-set-layout
* What went wrong:
KotlinSourceSet with name 'androidTest' not found.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 24s
Process exited with code 1
See https://teamcity.jetbrains.com/buildConfiguration/JetBrainsPublicProjects_Compose_Publish_2_AllGitHubRelease/4237033?buildTab=dependencies&mode=list&state=failed&type=snapshot&hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildProblemsSection=true#4237024
## Testing
./gradlew resources:library:test
1 year ago
Igor Demin
881b48b89d
Revert "Components. Fix `KotlinSourceSet with name 'androidTest' not found.` on Kotlin 1.9.0"
...
This reverts commit 1d0e8ded91
.
1 year ago