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

en-gb layout improvement #666

Open
edent opened this issue Aug 12, 2022 · 6 comments · May be fixed by #669
Open

en-gb layout improvement #666

edent opened this issue Aug 12, 2022 · 6 comments · May be fixed by #669
Labels

Comments

@edent
Copy link

edent commented Aug 12, 2022

I am set to "English UK":
settings

But the currency key is set to $.
keyboard

In other keyboards, the currency is set to £

Would it be possible to get that updated?

@edent edent added the layout label Aug 12, 2022
@edent
Copy link
Author

edent commented Aug 12, 2022

The layout is controlled in

https://github.com/openboard-team/openboard/blob/master/app/src/main/res/xml/rowkeys_qwerty2_left5.xml

I think it needs the code

<switch>
   <case latin:countryCode="GB">
      <Key
        latin:keySpec="d"
        latin:keyHintLabel="£"
        latin:additionalMoreKeys="£"
        latin:moreKeys="!text/morekeys_d" />
   </case>
   <default>
      <Key
        latin:keySpec="d"
        latin:keyHintLabel="$"
        latin:additionalMoreKeys="$"
        latin:moreKeys="!text/morekeys_d" />
   </default>
</switch>

@MajeurAndroid
Copy link
Member

MajeurAndroid commented Aug 13, 2022

@edent you where in the right path but currencies are actually handled in a dedicated common key style, see app/src/main/res/xml/key_styles_currency.xml.
The issue surprises me because from what I see everything looks ok, and nobody reported this so far.

@edent
Copy link
Author

edent commented Aug 13, 2022

@MajeurAndroid The currency key on the symbols panel is correct.

But what I'm talking about is the key on the main keyboard. The D key looks hard-coded to be $ no matter what the user's locale is.
red

@MajeurAndroid
Copy link
Member

MajeurAndroid commented Aug 13, 2022

@edent oh my bad, we are talking about 'more keys', sorry for that.
Yes definitely, I noticed this some time ago, but I could not find an elegant way of localizing only this attribute, to implement something every locale benefits from.
If you manage to do this, feel free to open a PR :)

@edent
Copy link
Author

edent commented Aug 14, 2022

I think there are two ways to do this.

The first is the code above added to the qwert2_left5. You could also expand it with other locales. For example, India uses QWERTY and their currency is ₹, and Ireland uses €:

<switch>
   <case latin:countryCode="GB">
      <Key
        latin:keySpec="d"
        latin:keyHintLabel="£"
        latin:additionalMoreKeys="£"
        latin:moreKeys="!text/morekeys_d" />
   </case>
   <case latin:countryCode="IE">
      <Key
        latin:keySpec="d"
        latin:keyHintLabel="€"
        latin:additionalMoreKeys="€"
        latin:moreKeys="!text/morekeys_d" />
   </case>
   <case latin:countryCode="IN">
      <Key
        latin:keySpec="d"
        latin:keyHintLabel="₹"
        latin:additionalMoreKeys="₹"
        latin:moreKeys="!text/morekeys_d" />
   </case>
   <default>
      <Key
        latin:keySpec="d"
        latin:keyHintLabel="$"
        latin:additionalMoreKeys="$"
        latin:moreKeys="!text/morekeys_d" />
   </default>
</switch>

There are a few other QWERTY countries which use different currencies. But that would be a start.

Alternatively, you could put the logic in app/src/main/res/xml/rowkeys_qwerty2.xml

I'm happy to send a PR for the first one, if you like - although I don't have the means to compile and test.

edent added a commit to edent/openboard that referenced this issue Aug 14, 2022
@edent edent linked a pull request Aug 14, 2022 that will close this issue
@AdamPS
Copy link

AdamPS commented Mar 31, 2023

This would be great to have. Is there anything I can do to help? I'm not an Android developer, however I could test an alpha version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants