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

getText doesn't work #24

Open
hugarburdur opened this issue Dec 27, 2022 · 1 comment
Open

getText doesn't work #24

hugarburdur opened this issue Dec 27, 2022 · 1 comment

Comments

@hugarburdur
Copy link

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
Copy link

jlcvp commented Jan 19, 2023

make sure you import the right function gettext without camelCase

import { gettext } from 'i18n'

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants