apinf / openapi-designer

Design interface for creating Open API (Swagger) specification files
https://openapi.design
MIT License
68 stars 18 forks source link

Add internationalization #199

Closed tulir closed 7 years ago

tulir commented 7 years ago

Fixes #99

This pull request adds internationalization (I18n) support to everything using aurelia-i18n (I18next). This also adds some of the Finnish translations.

Demo available at https://dev.openapi.design/feature/i18n/

tulir commented 7 years ago

Note to self: We can probably easily implement internationalization of field labels by simply using the full path to the fields as the I18n key. That way it requires no schema changes and we can use the current labels as fallback if necessary.

tulir commented 7 years ago

Internationalization is now implemented for most fields, but we need to add at least an English localization.

tulir commented 7 years ago

There's a continuation of this branch in the next pull request, so don't rebase this to avoid having to manually fix things.

tulir commented 7 years ago

@brylie I replaced all the form references with interpolations

brylie commented 7 years ago

In general, we can merge this as-is.

However, I am wondering if we can reduce the verbosity in our i18n keys:

A couple of minor improvements, to improve consistency, would be:

tulir commented 7 years ago

I moved all the generic I18n fields* into the i18n object and renamed the i18n function to localize. However, there are still a few problems with unlocalized fields that I need to check out.

* i18nKey is not a generic field, it only applies for Optionfield choices, so I left it as-is.

tulir commented 7 years ago

Now everything should work, testing in progress...

brylie commented 7 years ago

Ah, I merged, since the PR was still marked as ready for review.