-
-
Notifications
You must be signed in to change notification settings - Fork 124
Add unit conversion skill #372
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
base: master
Are you sure you want to change the base?
Conversation
…gth an hour in addition to length per hour
|
Units names were moved into strings.xml. Everything seems good in English but would definitely appreciate feedback about how it's handled in other languages |
|
Added currency conversion support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tylxr59 I am not sure if moving it into strings is the best option. Maybe it should be moved into it's own xml (or json file) where it can be translated by weblate as a separate component? It kind of clutters up the strings file right now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it would make sense to make it a separate Weblate component. I'm wondering though, isn't there some public database of unit names in various languages? E.g. I found unit definitions in unicode-cldr: https://github.com/unicode-org/cldr/blob/466e22b3ee3926e7e7492f575d865990e9c2d0c5/common/main/en.xml#L8619 . Maybe it would make sense to extend the unicode-cldr-plugin to extract such data too, so we don't have to make our translators translate all hundreds of units?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw for the units, Android already provides a lot of translations, maybe those are enough for us: https://developer.android.com/reference/android/icu/util/MeasureUnit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to using MeasureUnit in the new commit
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/Unit.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/UnitConversionSkill.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/stypox/dicio/skills/unit_conversion/Unit.kt
Outdated
Show resolved
Hide resolved
…itConversionSkill.kt Co-authored-by: Inhishonor <inhishonor@protonmail.com>
…it.kt Co-authored-by: Inhishonor <inhishonor@protonmail.com>
…itConversionSkill.kt Co-authored-by: Inhishonor <inhishonor@protonmail.com>
…itConversionSkill.kt Co-authored-by: Inhishonor <inhishonor@protonmail.com>
|
Added cryptocurrency pricing in a new skill. Was going back and forth about whether it should be included in unit_conversion but decided against it. My understanding is that most cryptocurrency users/enthusiasts track price in USD regardless of their local currency. |
Adds support for converting between units. Calculations are as accurate as I could make them and double-checked with other sources.
I did a fair amount of testing with this and it works well. It looks like the translation skill causes some issues on occasion.
Resolves #13 partially