Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Text Localization #14

Open
Sean343 opened this issue May 22, 2018 · 10 comments
Open

Text Localization #14

Sean343 opened this issue May 22, 2018 · 10 comments
Labels
feature request Feature request

Comments

@Sean343
Copy link

Sean343 commented May 22, 2018

Hi,

Is it possible to localise the text so that it supports multiple languages? I have a number of users from non-english speaking countries.

@michalmachniak
Copy link

Hello, any update on it? I think this is one of the most important case in this project right now - if it is intendend to inform all EU users appropriately they should be given explenation in their language.

@dzungpv
Copy link

dzungpv commented May 25, 2018

Edit the lib yourself, create html for each language see this line https://github.com/googleads/googleads-consent-sdk-android/blob/master/consent-library/src/main/java/com/google/ads/consent/ConsentForm.java#L271
I think this lib is not build for localization from the start. They use html, js technology for both Android and iOS

@iordachiv
Copy link

I think that native library/sdk should display also native dialog and not render html (with javascript and so one) instead.

@Diranus
Copy link

Diranus commented May 25, 2018

Idea for a quick solution:
Probably it would be useful to exclude the path passed to webView.loadUrl() into a member variable which can be changed by setConsentFormUrl() or something like this to get multilanguage support without hacking the lib itself (I hate that! It breaks the ability to update).
Then we can have multiple variants of consentform.html in the asset folder.

@dzungpv
Copy link

dzungpv commented Jun 12, 2018

I think a simple edit can support other language:

String countryiso3 = Resources.getSystem().getConfiguration().locale.getISO3Country();
this.webView.loadUrl("file:///android_asset/consentform_"+"countryiso3"+".html");

And then translate the html form for each language, put it in your asset folder and you are done

@codenia
Copy link

codenia commented Jun 12, 2018

Here are 10 languages for which I have ordered a translation. The texts were translated by a translation team. I cannot guarantee the correctness of the translation.

consentform.zip

Chinese (Simplified)
Dutch
French (France)
German
Italian
Japanese
Korean
Russian
Portuguese (Portugal)
Spanish (Spain)

In the file ConsentForm.java I changed the function load(). In the strings file I added a "consentform" string with the filename for for every language I use.

    public void load() {
        if (this.loadState == LoadState.LOADING) {
            listener.onConsentFormError("Cannot simultaneously load multiple consent forms.");
            return;
        }

        if (this.loadState == LoadState.LOADED) {
            listener.onConsentFormLoaded();
            return;
        }

        this.loadState = LoadState.LOADING;

        // Codenia code
        **this.webView.loadUrl("file:///android_asset/" + Helper.getLocalizedString(R.string.consentform) + ".html");**
        //this.webView.loadUrl("file:///android_asset/consentform.html");
    }

@witoldgoralski
Copy link

Thank you for sharing. I think that Chinese, Japanese, Korean and Russian should not be provided with library. As far as I know only for EEA (European Economic Area) countries this consent should be displayed. European Economic Area countries: https://europa.eu/european-union/about-eu/countries_en#tab-0-0

@codenia
Copy link

codenia commented Jun 13, 2018

Yes, but in Europe there are many Chinese people who have set Chinese language on their smartphone or many Russians who have set Russian language. (And so on)

@witoldgoralski
Copy link

It make sense for me. But it is bad news.

@rampara rampara added the feature request Feature request label Jun 18, 2018
@vrerabek
Copy link

I am using #86 as temporary solution with my own consentform.html files and it's working well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants