Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the index.html to address the i18n issue #12

Closed
wants to merge 7 commits into from

Conversation

MichaelWangzitao
Copy link
Contributor

@MichaelWangzitao MichaelWangzitao commented Mar 8, 2021

Update the MiniApp Manifest index.html to address the i18n issues, I rewrite section 6 add a subsection to provide an i18n solution. #4 #5 #6@aphillips @zhangyongjing @xfq


Preview | Diff

Update the MiniApp Manifest index.html to address the i18n issues, I rewrite section 6 add a subsection to provide an i18n solution.
@xfq xfq added the i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. label Mar 9, 2021
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
Fix the format issue on line 1104
Updated to fix json example format.
Fixed the json example format
Comment on lines +1147 to +1149
<p>i18n/en-US.json</p>
</div>
<pre class="example json">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>i18n/en-US.json</p>
</div>
<pre class="example json">
<pre class="example json" title="i18n/en-US.json">

Comment on lines +1162 to +1164
<p>i18n/zh-Hans.json</p>
</div>
<pre class="example json">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>i18n/zh-Hans.json</p>
</div>
<pre class="example json">
<pre class="example json" title="i18n/zh-Hans.json">

@xfq
Copy link
Member

xfq commented Mar 31, 2021

Note that this is a solution for the localization problem, but did not solve the string metadata problem, i.e., multiple natural language text fields still share the same language/direction, so it won't close issue #4, #5, and #6.

@MichaelWangzitao
Copy link
Contributor Author

MichaelWangzitao commented Mar 31, 2021

Note that this is a solution for the localization problem, but did not solve the string metadata problem, i.e., multiple natural language text fields still share the same language/direction, so it won't close issue #4, #5, and #6.


I'm not sure about it. This proposal allows multiple natural language text fields to be dynamically filled with local language information, such as description, which is filled with "$string:description_application" on the manifest but is actually be translated into the corresponding local language.

@xfq
Copy link
Member

xfq commented Apr 1, 2021

Localization of the whole manifest and language/direction metadata of strings are two different issues.

Localization

IIUC this pull request solves the localization problem.

For example, for the following manifest:

{
  "dir": "ltr",
  "lang": "en-US",
  "appID": "org.w3c.miniapp",
  "name": "$string:name",
  "short_name": "string:short_name",
  "description": "$string:description_application",
}

We can add the following to i18n/zh-Hans.json:

{
    "strings": { 
      "name":"小程序试用版",
      "short_name":"小程序",
      "description_application":"迷你程序试用版本",
    }
}

If the language of the app store is Simplified Chinese, the app store will parse the "name": "$string: name" object in the manifest, and extract the information from the zh-Hans.json file in the i18n directory.

String metadata

The language of a miniapp is Hebrew does not mean that all strings in the manifest are RTL, and the language of a miniapp is Japanese does not mean that all strings in the manifest are ja (for example, it may be a Chinese language learning app for Japanese people, and the app name is in Simplified Chinese, if the language is marked as ja instead of zh-Hans, the font may be incorrect).

For example, if we have a miniapp whose name is Easy as one שתיים three.

If the miniapp is an English miniapp (dir is ltr), it will display as expected:

easy

If the miniapp is a Hebrew miniapp (dir is rtl), without stipulating the base direction for the string, the order of the items will change, and begin to be unreadable or misleading:

easy_RTL

You can see the result by looking at how browsers render the following HTML snippet:

<p dir="ltr">Easy as one שתיים three</p>
<p dir="rtl">Easy as one שתיים three</p>

We can't change the manifest-wide dir from rtl to ltr, because other information (such as the description) may need to be in rtl.

Although miniapp developers could theoretically apply the Unicode directional formatting characters, they are not easy to type and it can be difficult for the developer to know how to use the characters effectively.

This is just one example use case for string-specific directional information, and there are others as well.

@espinr
Copy link
Collaborator

espinr commented Nov 7, 2023

Closing this PR because we will use the i18n WG localizable manifest recommendations and follow the Web App manifest approach.

@espinr espinr closed this Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants