Paul Watson
Paul Watson

Reputation: 824

Opposite of notranslate class for translation services

In HTML, you can direct translation services not to translate certain HTML elements by adding class="notranslate" to them (source).

Is there any method to create the opposite behavior? Such that you can mark the elements that should be translated, and only those will be?

Upvotes: 1

Views: 725

Answers (1)

Selfish
Selfish

Reputation: 6200

You can use the class notranslate on your body. Then, use the same method with inner nodes using the class translate.

<body class="notranslate">
    <p class="translate">Will be translated</p>
    <p>Will not be translated</p>
</body>

Upvotes: 2

Related Questions