zepp-health / zeppos-samples

A collection of samples about Zepp OS watchfaces and applications
Apache License 2.0
150 stars 53 forks source link

getText doesn't work #24

Open hugarburdur opened 1 year ago

hugarburdur commented 1 year ago

Hi, I'm new to Zepp OS development so I'm trying to run the "Hello World" Mini Program with API 2.0. The problem is the "Hello World" text doesn't show on the simulator or real device, instead I get "appName". The widget is created in /page/gtr/home/index.page.js and text is styled in /page/gtr/home/index.style.js :

import { getText } from '@zos/i18n'

export const TEXT_STYLE = {
  text: getText('appName'),
}

in /page/i18n/en-US.po :

msgid "appName"
msgstr "Hello World"

If I change text: getText('appName') to text: getText('appName2') for example, "appName2" is shown on the device.

jlcvp commented 1 year ago

make sure you import the right function gettext without camelCase

import { gettext } from 'i18n'

...
export const TEXT_STYLE = {
  text: gettext('appName'),
}