0

I have his following code:

public class MySimpleArrayAdapter extends ArrayAdapter {

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    LayoutInflater inflater = (LayoutInflater) mContext
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View rowView = inflater.inflate(R.layout.todo_list, parent, false);

    TextView titleTextView = (TextView) rowView
            .findViewById(R.id.todo_row_title);
    TextView dateTextView = (TextView) rowView
            .findViewById(R.id.todo_row_date);
    ImageView imageView = (ImageView) rowView
            .findViewById(R.id.todo_row_image);

        titleTextView.setText(mTitles[position]);

..

}

and this content:

mTitles = [עברית, english, עברית]

meaning some strings in hebrew, and some in english

I run this on my physical device.

However in the UI is see only dates strings. How can I enable hebrew viewing?

Other apps on my mobile shows hebrew.

4

1 回答 1

0

您将需要一个国际化库来处理语言转换。

Gettext-Commons是一个流行的,还有很多其他的。

https://code.google.com/p/gettext-commons/

这是一个示例,演示了使用 Gettext Commons 是多么容易:

I18n i18n = I18nFactory.getI18n(getClass());
System.out.println(i18n.tr("This text will be translated"));
于 2013-09-26T14:54:59.343 回答