mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Undo a breaking change with I18nUtil.instance (#45390)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45390 This undos a breaking change with I18nUtil for Kotlin consumer. I've re-added a `getInstance` method so that Kotlin libraries won't break. The method is added as Deprecated as those libraries need to migrate to `.instance` accessors as more idiomatic. Changelog: [Android] [Fixed] - Undo a breaking change with I18nUtil.instance Reviewed By: alanleedev Differential Revision: D59638044 fbshipit-source-id: 1c93a98676b5b01e89be3b974961c5f3ae919511
This commit is contained in:
committed by
Blake Friedman
parent
50643a300c
commit
b8b9e9ee7d
@@ -3397,6 +3397,7 @@ public final class com/facebook/react/modules/i18nmanager/I18nUtil {
|
||||
}
|
||||
|
||||
public final class com/facebook/react/modules/i18nmanager/I18nUtil$Companion {
|
||||
public final fun DEPRECATED$getInstance ()Lcom/facebook/react/modules/i18nmanager/I18nUtil;
|
||||
public final fun getInstance ()Lcom/facebook/react/modules/i18nmanager/I18nUtil;
|
||||
}
|
||||
|
||||
|
||||
+11
@@ -86,5 +86,16 @@ public class I18nUtil private constructor() {
|
||||
private const val KEY_FOR_PREFS_FORCERTL = "RCTI18nUtil_forceRTL"
|
||||
private const val KEY_FOR_PERFS_MAKE_RTL_FLIP_LEFT_AND_RIGHT_STYLES =
|
||||
"RCTI18nUtil_makeRTLFlipLeftAndRightStyles"
|
||||
|
||||
/**
|
||||
* We're just re-adding this to reduce a breaking change for libraries in React Native 0.75.
|
||||
*
|
||||
* @deprecated Use instance instead
|
||||
*/
|
||||
@Deprecated(
|
||||
"Use .instance instead, this API is only for backward compat", ReplaceWith("instance"))
|
||||
@JvmName(
|
||||
"DEPRECATED\$getInstance") // We intentionally don't want to expose this accessor to Java.
|
||||
public fun getInstance(): I18nUtil = instance
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user