Sha256: e663028130718c237ec02c0fe99674edbba80261b3301a0e06060df7b942ed00

Contents?: true

Size: 845 Bytes

Versions: 50

Compression:

Stored size: 845 Bytes

Contents

package sh.calaba.instrumentationbackend.actions.l10n;

import sh.calaba.instrumentationbackend.InstrumentationBackend;

/**
 * Helper to access Android L10n files.
 * 
 * @author Dominik Dary
 * 
 */
public class L10nHelper {
  /**
   * get the translated value based on the current active locale.
   * 
   * @param l10nKey The l10n key to use
   * @return The translated value.
   */
  public static String getValue(String l10nKey) {
    int resourceId =
        InstrumentationBackend.solo
            .getCurrentActivity()
            .getResources()
            .getIdentifier(l10nKey, "string",
                InstrumentationBackend.solo.getCurrentActivity().getPackageName());

    String localizedString =
        InstrumentationBackend.solo.getCurrentActivity().getResources().getString(resourceId);

    return localizedString;
  }
}

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
testautoa-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
testautoa-0.4.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
testautoa-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.3.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
testautoa-0.4.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
calabash-android-0.4.0.pre18 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
testautoa-0.4.0.pre19 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
testautoa-0.4.0.pre18 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java