Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PlatformLocale and StringDelegate for k/wasm (#561) #625

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

eymar
Copy link
Member

@eymar eymar commented Jul 7, 2023

This PR "upstreams" #561 from wasm-main to jb-main

* Workaround `isOnUiThread` (ui-test) for k/wasm browser target

* Implement PlatformLocale  and StringDelegate for k/wasm

* Get rid of expect/actuals for jsWasmMain and use js(...) for a common implementation

* use the list of preferred languages - `window.navigator.languages`

* delete unused fun `currentLanguageTag`
@eymar eymar requested a review from igordmn July 7, 2023 09:15
}
}

internal actual fun PlatformLocale.isRtl(): Boolean = false // TODO

private val rtlLanguagesSet = setOf("ar", "fa", "he", "iw", "ji", "ur", "yi")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the source of this? Can we add a link in a comment?

This list has more RTL languages

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember it's from sources of function that we call on java target

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. I added a comment.

It was taken from here https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/java/awt/ComponentOrientation.java#L156 to follow the desktop impl.

@eymar eymar merged commit e92f3b2 into jb-main Jul 10, 2023
@eymar eymar deleted the upstream_561_to_jb-main branch July 10, 2023 12:17
Walingar pushed a commit to Walingar/androidx that referenced this pull request Jul 11, 2023
JetBrains#625)

* Implement PlatformLocale and StringDelegate for k/wasm (JetBrains#561)

* Workaround `isOnUiThread` (ui-test) for k/wasm browser target

* Implement PlatformLocale  and StringDelegate for k/wasm

* Get rid of expect/actuals for jsWasmMain and use js(...) for a common implementation

* use the list of preferred languages - `window.navigator.languages`

* delete unused fun `currentLanguageTag`

* Add a comment
mazunin-v-jb pushed a commit that referenced this pull request Jul 11, 2023
* Implement PlatformLocale and StringDelegate for k/wasm (#561)

* Workaround `isOnUiThread` (ui-test) for k/wasm browser target

* Implement PlatformLocale  and StringDelegate for k/wasm

* Get rid of expect/actuals for jsWasmMain and use js(...) for a common implementation

* use the list of preferred languages - `window.navigator.languages`

* delete unused fun `currentLanguageTag`

* Add a comment
eymar pushed a commit that referenced this pull request Dec 18, 2023
Please see [b/204328129](https://issuetracker.google.com/issues/204328129) for more details on the issue.

Basically this is something necessary to help prevent weird compilation errors that happen with the Buck/Redex build toolchains that Meta uses. Not something meaningful, but since the change is dead simple I guess it shall pass.

Test: This has been something that was patched on Meta source and we've been testing it for multiple prod releases of Threads, we're only now porting the change to Google because it seems appropriate.

Fixes: b/204328129

This is an imported pull request from androidx#625.

Resolves #625
Github-Pr-Head-Sha: 0568741
GitOrigin-RevId: 023a53d

Change-Id: I5b3fe39e54ffd4f97234c0ff23e54f9b790b2f0f
igordmn pushed a commit that referenced this pull request Dec 20, 2023
Please see [b/204328129](https://issuetracker.google.com/issues/204328129) for more details on the issue.

Basically this is something necessary to help prevent weird compilation errors that happen with the Buck/Redex build toolchains that Meta uses. Not something meaningful, but since the change is dead simple I guess it shall pass.

Test: This has been something that was patched on Meta source and we've been testing it for multiple prod releases of Threads, we're only now porting the change to Google because it seems appropriate.

Fixes: b/204328129

This is an imported pull request from androidx#625.

Resolves #625
Github-Pr-Head-Sha: 0568741
GitOrigin-RevId: 023a53d
(cherry picked from https://android-review.googlesource.com/q/commit:ca6fa30821e365ed3976bbcd0202c38b9da2c842)
Merged-In: I5b3fe39e54ffd4f97234c0ff23e54f9b790b2f0f
Change-Id: I5b3fe39e54ffd4f97234c0ff23e54f9b790b2f0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants