Closed cressie176 closed 9 years ago
Well you can check if your i18n instance has locales by checking i18n.locales
if this is what you want ?
No - it was more about how to configure defaults if a particular translation wasn't found. Something a bit similar to Spring's [Message Source]. The project's moved on considerably since posting so I'll close.
First of all thanks for sharing your hard work on i18n-2. Secondly I'd like to make a change but wanted to check it was something you're interested in first.
We're using the following snippet to localise 'Word document', 'Powerpoint document', etc.
If someone uploads a file type that has no translation for this will end up displaying 'fileType.xyz', when really we want to display nothing. We could maintain a list of known filetypes but I'd rather test to see if the translation is available.
A further enhancement could be to pass the default value to req.i18n.__ but because of the var args I suspect this would require a new method, e.g.
Not quite sure how this could be made to work with plurals though. Assuming you're happy with the above I'll fork and PR