Skip to content

Conversation

@9999years
Copy link
Contributor

This adds a new EnglishAbbreviated Language which takes advantage of the
additional Language methods introduced in
#36 in order to produce more compact
output.

I'm not sure this feature is appropriate for this library (none of the
other Languages encode stylistic opinions like this), but I wanted to
demonstrate the usage of the features.

@vi
Copy link
Owner

vi commented Aug 29, 2025

Maybe this mode should also be documented in the README.md?

@9999years
Copy link
Contributor Author

TBH I'm not sure if this belongs in the library (I can imagine people wanting week to be w and not wk, for example), I mostly wrote it as an example. But if you want me to polish it for merge, I'm happy to do that!

This adds a new `EnglishAbbreviated` `Language` which takes advantage of the
additional `Language` methods introduced in
vi#36 in order to produce more compact
output.

I'm not sure this feature is appropriate for this library (none of the
other `Language`s encode stylistic opinions like this), but I wanted to
demonstrate the usage of the features.
@vi
Copy link
Owner

vi commented Aug 29, 2025

The library's development is mostly driven by external contributions. If you need that function in your app and want to depend on timeago, it can be added.

There is already super-short format in format_5chars, so it may make sense to have moderately abbreviated format as well.

Question whether to do it as a pseudo-language or invent some other API is open. Maybe for the reasons of pragmatism/simplicity abbreviated forms can be kept as pseudo-languages when their number is small (e.g. for in this pull request, it is English-only). If somebody else contributes more abbreviated languages, we can introduce an API change (and keep EnglishAbbreviated as a deprecated alias for English with additional abbrev parameter set).

@vi
Copy link
Owner

vi commented Aug 29, 2025

Note that you may want to add something to from_isolang in mod.rs to make the abbreviated form triggerable. Or at least make it accessible in main.rs CLI tool.

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