Internationalization for documentation #104
Comments
Do we need to list the supported locales in the raml doc or can we just identify the root directory of the locales? The locale sub-folders should be named using the standard locale names. That way when someone creates another translation they don’t have to change he raml file itself, just add a new sub-folder. |
@tgullotta I think we should always be explicit. Otherwise web tools won't know where or what to load ahead of time. |
I guess the question is: do we treat locales like an enum, where the On Wed, Sep 17, 2014 at 11:21 AM, Blake Embrey notifications@github.com
|
Do locales cascade when not specified? Google+ has interesting behaviour down to the region for a comparison. E.g. |
are there any restrictions regarding where the !bundle tag can be used? |
@svacas I would alter the wording to say that a !bundle tag should only be used in a scalar context on the value side. |
@dmartinezg I think the usage should be restricted even more to documentation related values, otherwise it could be easily abused. You could end up with resources that have different sets of methods depending on the locale or parameters required for some languages and optional for others. e.g: |
#%RAML NOT_VALID
version: v1
baseUri: http://github.com/{version}{localeExtension}
title: {locale}.title
documentation
- title {locale}.chapter1title
!bundle {locale}.chapter1
localeExtension:
default: en_UK
required: false
pattern: ^(?:-)([a-zA-Z]{2})([-_]([a-zA-Z]{2}))?$
magic: locale is normalized string aa_AA of matching patterns
/users{localeExtension}{mediaTypeExtension} |
Apologies if this is implied by the above, but it would also be desirable to localize query parameters, values, etc. |
RAML 1.0 will not support an OOTB standard to define internationalization in this version. Nevertheless, it is not out of question to add support in any later version. |
Right now you can achieve that using overlays. |
By adding a
locales
root level property, and a keyword to reference text bundles, RAML 1.0 can provide support for localization of documentation.A resource bundle is a YAML file, which contains a mapping, where each key is the name of a text resource, and each value is the value for that text resource string in a given locale.
Where
docs/en_US.bundle.yaml
containsWhere
docs/en_US.bundle.yaml
containsRAML processors must pick the resource bundle which best matches the consumers locale.
The text was updated successfully, but these errors were encountered: