PebbleTemplates / pebble

Java Template Engine
https://pebbletemplates.io
BSD 3-Clause "New" or "Revised" License
1.09k stars 166 forks source link

i18n-alias - adding i18 function alias with `messages` bundle as default #638

Closed ilyas-gx closed 1 year ago

ilyas-gx commented 1 year ago

Most of the time there is only one bundle - messages, so this shortcut/alias is really useful for that cases.

ebussieres commented 1 year ago

Instead of creating a new function with a funky name (Just 't'), we should modify the i18n function to use a default value if no value for bundle are found.

ilyas-gx commented 1 year ago

@ebussieres , this "funky" name is well known and widely used by dev community across many projects.

But it's up to you, guys. I already have this code in my own projects so I'm just sharing.