- Force MFA for privileged Rubygems actions.
- This version is only to actually include this CHANGELOG in the gem, so you can see the below if you compare gem diffs 😅
-
This version is only to clarify a backwards incompatibility if relying on undocumented behaviour:
Readers like
post.title
no longer accept (and ignore) arbitrary keyword arguments.So if you would e.g. override a reader like this before:
def my_title(my_arg:) super || "my fallback #{my_arg}" end
You will instead need to do:
def my_title(my_arg:) super() || "my fallback #{my_arg}" end
- Feature: You can pass a desired locale to readers and query methods, e.g.
post.title(locale: :de)
to get the German-locale title, andpost.title?(locale: :de)
to check if one exists. This ignores fallback settings – useI18n.with_locale(:de) { post.title }
if you want fallbacks.
- Feature:
locale_columns
without a passed column name returns all locale columns. Thanks to manuelmeurer!
- Feature: Add
fallback: :i18n
to use the fallbacks fromI18n.fallbacks
. Thanks to sunny!
- Change
locale_columns
andlocales_for_attribute
to sort current locale first, then default locale (previously, it was default locale first). This makes more sense for our own apps, and hopefully other apps as well.
- Drop support for end-of-lifed Ruby 2.1 and 2.2.
- Traco now automatically adds query methods, e.g.
Item#title?
whentitle
is translated.
- Internal cleanup.
- Bugfix: with
fallback: [:sv]
, always look at current locale before any fallbacks.
- Introduce e.g.
fallback: [:sv]
to explicitly specify fallbacks.
Make license (MIT) easier to autodetect.
- Bugfix: don't raise error loading models before the DB is created. Thanks to PikachuEXE and Andrii Malyshko.
- Bugfix: restore sorting of
locale_columns
andlocales_for_attribute
to put default locale first, not current locale. Thanks to PikachuEXE.
-
~20 time speedup thanks to optimizations by Andrii Malyshko.
Reading a Traco translated attribute used to be ~250x slower than an untranslated attribute; now it's down to ~10x slower.
- Bugfix:
.current_locale_column
handles dashed locales like "pt-BR" correctly. Thanks to PikachuEXE.
- Bugfix around fallbacks and memoization. Thanks to PikachuEXE.
- Introduce
.current_locale_column
, e.g.Post.current_locale_column(:title) # => :title_sv
.
- Backwards incompatible:
fallback: true
is nowfallback: :default
. Since this was the implicit default value, you shouldn't have a problem unless you explicitly declared this value.
fallback: :any
to fall back to any other locale if the text is blank in the current and default locales.
- Attribute readers can override the attribute's
fallback
setting, e.g.item.title(fallback: false)
.
- Backwards incompatible: for dashed locales like "pt-BR", the column names are now expected to end in e.g.
_pt_br
, not_pt-BR
.
Whatever we had before introducing this changelog.