Add options for cardinal/ordinal plural types#259
Add options for cardinal/ordinal plural types#259oliver-ni wants to merge 1 commit intoprojectfluent:mainfrom
Conversation
|
@oliver-ni to answer on using "type" in Rust, you can use raw identifiers. |
gregtatum
left a comment
There was a problem hiding this comment.
The changes look reasonable, but I have a few requested changes.
@oliver-ni to answer on using "type" in Rust, you can use raw identifiers.
Thought: I think I prefer kind here, it's used other places in the codebase.
Suggestion: This code is missing tests. It would probably be good to add some unit tests to the file, and see if there are relevant areas that an integration test could be added.
| use crate::types::FluentValue; | ||
|
|
||
| #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] | ||
| pub enum FluentNumberKind { |
There was a problem hiding this comment.
Suggestion: Please add docs here, with a link to the relevant Fluent documentation, and an example of what the .ftl syntax looks like.
|
Closing as stale. Feel free to re-open if you want to address the requested changes. |
Adds functionality for switching between plural types (cardinal and ordinal).
Fluent docs include this option in the
NUMBERbuilt-in function. Sincefluent-rsdoesn't have that yet, I included it in the place where all the other number options were. Please let me know if this isn't the appropriate place / way to include this functionality.Also, I called it
kindinstead oftypesince the latter is a Rust keyword... a little weird but not sure if there's a better way to deal with that.