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

Add layout direction support to library #50

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nasrabadiAM
Copy link

Add Layout Direction Support to Lyricist

Description:

This pull request introduces support for layout direction alongside resources in the lyricist library. This feature is essential for applications that need to support right-to-left (RTL) languages such as Arabic, Hebrew, and Persian. By integrating layout direction handling, developers can ensure that their applications provide a seamless and user-friendly experience for RTL language users.

Changes Introduced:

  • Added functionality to specify layout direction (LTR or RTL) for each supported language/locale.
  • Implemented automatic adjustment of UI elements based on the specified layout direction.
  • Ensured seamless integration with existing resource management workflows within lyricist.

Use Case:

Consider an application that supports both English (LTR) and Arabic (RTL) languages. With this feature, developers can easily configure resources and layout direction preferences for each language, ensuring a polished and accessible experience for users regardless of their language's text direction.

Additional Notes:

This pull request addresses the feature request I submitted in issue #47. Initially, I implemented this feature for my own usage due to the lack of response on the issue. If this aligns with the goals of the lyricist project, I would be thrilled to see it merged into the main codebase. If not, please feel free to close this pull request.

Thank you for your consideration. I look forward to any feedback or suggestions you may have.

Contact Information:

Please feel free to reach out if further clarification or details are needed regarding this implementation.

@DevSrSouza
Copy link
Collaborator

In the first glance, I think layout direction could be easily implemented as a extension function instead of a actual configuration that the Strings data class have.

val locale = Locale.forLanguageTag(localeStr)
val layoutDirection = TextUtils.getLayoutDirectionFromLocale(locale)

I don't see a UseCase where a simple extension that gets the current Lyricist locale and apply the LayoutDirection using platform Locale apis.

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.

2 participants