vmware / vmware/singleton

[BUG] [Python Client]Get translation from offline bundle first when online and offline mode are supported.

Open
#982 2 comments 0 reactions 1 assignee View on GitHub

@jin-jasper is already working on this.

Since Jan 26, 2021.

area/python-client kind/bug priority/medium triage/wontfix
Dominant language
Java
Stars
72
Forks
69
Avg merge
23h 32m
Merged PRs (30d)
4

Description

Describe the bug
Get translation from offline bundle first when when online and offline mode are supported.

To Reproduce
Steps to reproduce the behavior:

  1. Set config as below in config.yml
    online_service_url: http://localhost:8091/singleton/PythonClient/4.0.0/
    offline_resources_base_url: file://d:/l10ntest/PythonClient/4.0.0/
    log_path: ./log/
    cache_path: ./singleton/
    try_delay: 10
    cache_expired_time: 60
  2. The key "about.message" both exist in online bundle and offline bundle.
    I18n.add_config_file('sample_online_offline.yml')
    I18n.set_current_locale("fr")
    self.rel = I18n.get_release(PRODUCT, VERSION)
    translation1 = self.rel.get_translation()
    trans1 = translation1.get_string("about", "about.message")
    time.sleep(5)
    tran2 = translation1.get_string("about", "about.message")
    the result trans1 is the fr translation that exist offline bundle
    the result trans2 is the fr translation that exist online bundle

Expected behavior
Both trans1 and trans2 should be the fr translation that exist online bundle

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.