-
-
Notifications
You must be signed in to change notification settings - Fork 768
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ICU-23044 MF2, ICU4J, bring the implementation close to the spec at L…
…DML 47
- Loading branch information
Showing
55 changed files
with
2,442 additions
and
805 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
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
78 changes: 78 additions & 0 deletions
78
icu4j/main/core/src/main/java/com/ibm/icu/message2/Directionality.java
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,78 @@ | ||
// © 2025 and later: Unicode, Inc. and others. | ||
// License & terms of use: https://www.unicode.org/copyright.html | ||
|
||
package com.ibm.icu.message2; | ||
|
||
import com.ibm.icu.util.ULocale; | ||
|
||
/** | ||
* Encodes info about the direction of the message. | ||
* | ||
* <p>It is used to implement the @code u:dir} functionality.</p> | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
public enum Directionality { | ||
/** | ||
* Not initialized or unknown. | ||
* | ||
* <p>No special processing will be used. | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
UNKNOWN, | ||
/** | ||
* Left-to-right directionality. | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
LTR, | ||
/** | ||
* Right-to-left directionality. | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
RTL, | ||
/** | ||
* Directionality determined from <i>expression</i> contents. | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
AUTO, | ||
/** | ||
* Directionality inherited from the <i>message</i> or from the <i>resolved value</i> | ||
* of the <i>operand</i> without requiring isolation of the <i>expression</i> value. | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
INHERIT; | ||
|
||
/** | ||
* Determines the directionality appropriate for a given locale. | ||
* | ||
* @param ulocale the locale to determine the directionality from. | ||
* @return the appropriate directionality for the locale given. | ||
* | ||
* @internal ICU 77 technology preview | ||
* @deprecated This API is for technology preview only. | ||
*/ | ||
@Deprecated | ||
public static Directionality of(ULocale ulocale) { | ||
if (ulocale == null ) { | ||
return Directionality.INHERIT; | ||
} | ||
return ulocale.isRightToLeft() ? Directionality.RTL : Directionality.LTR; | ||
} | ||
} |
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
Oops, something went wrong.