Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8162139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:38:39+00:00 2026-06-06T18:38:39+00:00

In an ongoing website development project I style all ‘o’ characters in a certain

  • 0

In an ongoing website development project I style all ‘o’ characters in a certain visible text area to a red color, using a html span tag and css, like this:

Questi<span class="redcharacter">o</span>n.
.redcharacter { color: red; }

The problem is that when I use the google website translator that I have added to the website, the span tag breaks the words and google translates the separate parts instead of the whole word (“Questi” as one word, “o” as one word, and “n” as one word).

My question is: Is there a way to make the “google website translator” translate the whole word and still let me style individual characters?

I have so far tried (without luck):

  1. Searching for other ways of styling individual characters.
  2. Searching for a way to “hook on” to some google translation javascript function
    so that I could remove the span tags prior to the translation. It
    would be acceptable not to have the individual characters styled in
    the translated pages, as long as the translation of the text itself
    works.

Thank you in advance, and thank you for this amazing website, it has helped me tremendously lately!

EDIT: This is the code I use to include the “Google website translator” on my page:

<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script>function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', autoDisplay: false}, 'google_translate_element');}</script>
<div id="google_translate_element"></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:38:40+00:00Added an answer on June 6, 2026 at 6:38 pm

    You can use JavaScript’s innerHTML property to get the text inside of the textarea, then replace all occurrences of <span class="redcharacter">o</span> with just the letter o. Then send that text out to be translated.

    function translate(){
        text = document.getElementById('myTxtArea').innerHTML;
        parsedText = text.replace("<span class="redcharacter">o</span>","o");
        // send parsedText to Google Translate...
        // do something with what is returned
    }
    

    Something like that.

    edit:
    In light of new details;
    My first recommendation would be to look on Google for a different means of sending and receiving words and their translations. One that gives you some freedom. Looking at the code, it looks like they plant a copy of the box from translate.google.com into your page.

    If that doesn’t work, follow the link to the source code and copy the code there to your own file. Modify that code (it’s kind of a confusing read) and put it into your site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project ongoing at the moment that uses dynamic text blocks to
We've got this large application written in Delphi 5, and development is ongoing to
Here's the latest hurdle in my ongoing quest to automate my job : All
I'm back again with my ongoing saga of Student-Project Allocation questions. Thanks to Moron
I am working on a current ongoing project where, there are two instances of
I need to close all ongoing Linux TCP sockets as soon as the Ethernet
As part of an ongoing class project, we were asked to implement Maps for
Working with my ongoing TFrames-based component set project, I'm coming across various instances where
I wonder if there is an ongoing opensource project somewhere that mimics the MVC
For an ongoing project i have to implement a Flash-Welcome screen similar to this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.