How to inject text into the beginning of a textfield? I have a multilingual site with 3 languages where only 1 field (Description) is really multilingual, everything else is a translated interface and strings.  

For the Description field, it has been my aim to replicate the functionality of Wordpress's "qTranslate" plugin so that the UI looks something like this:
 

I have almost managed to achieve this using Fieldgroup module, 3 description fields, and Language Sections module (because I found no better way to assign each field to its language).

So far so good. But at the top of each field I have to put in default texts (=fr  =en= =el=) so that Language Sections module knows which field is which language and displays the correct text depending on which is the current language.  If the end-users delete those =en= and =fr= tags, then the whole thing falls apart.  

So I need a module that will inject those =fr= and =en= tags at the beginning of each textfield's entered text, in a way that's completely transparent to the user. Is there such a module?  Can Rules achieve a functionality like this?

Alternatively, if there is no such module, how would one go about creating one? Which function or which hook to use?  



UPDATE
I made this module called language_markers based on the answer given by Beebee ,but it didn't work. Can you pleasetellmewhat I'mdoing wrong? :

&lt;?php

function language_markers_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'property_for_sale_node_form' || $form_id == 'property_to_rent_node_form') {
    $form['#submit'][] = 'language_markers_submit_handler_function';
  }
}

function language_markers_submit_handler_function($form, &amp;$form_state) {
  foreach($form_state['values'] as $field_name =&gt; $value) {
    switch($field_name) {
      case 'field_description_fr':
        $value = '=fr= '.$value;
        break;
      case 'field_description_nl':
        $value = '=nl= '.$value;
        break;
      case 'field_description_en':
        $value = '=en= '.$value;
        break;
    }
  }
}




UPDATE 2:
I have managed to get this to work with Rules module: 

Event: After updating existing content of type Property for Sale

Condition: none

Action: Set a data value Parameter: Data: [node:field-description-en..., Value: =en= [node:field-description-en:value]

It works,but when the end-user comes back to edit the node, he sees "=en=" in front of his text. That's a BAD User-Experience. 
This is a work-around, not a solution. I still need a solution.
Do your fields have a different field name per language? For example, maybe they follow some sort of convention like field_description_en, field_description_cn, field_description_de?

If so, then perhaps you can use hook_form_alter and add your own submit handler into the form like so : 

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'mytype_node_form') {
    $form['#submit'][] = 'my_custom_submit_handler_function';
  }
}


Then create a function my_custom_submit_handler_function($form, &amp;$form_state). Inside the function you'll need to loop through $form_state['values'] like so and just append your language strings before the values:

function my_custom_submit_handler_function($form, &amp;$form_state) {
  foreach($form_state['values'] as $field_name =&gt; &amp;$value) { // &lt;-- forgot the &amp; here... oops
    switch($field_name) {
      case 'description_en':
        $value = '=en='.$value;
        break;
      case 'description_cn':
        $value = '=cn='.$value;
        break;
      case 'description_de':
        $value = '=de='.$value;
        break;
    }
  }
}


There's probably better ways to do it though.



Update

@drupalina I forgot to put the ampersand on the submit handler function which would have updated $form_state. Here's your code with a working version:

&lt;?php

function language_markers_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'property_for_sale_node_form' || $form_id == 'property_to_rent_node_form') {
    // You can remove the texts here too. Below is just an example.
    // Path inside $form may not be correct, so
    // do a var_dump($form) or dpm($form, 'form'); to check the array
    // To use dpm() you need to install "devel" module and enable it.
    #dpm($form, 'form');

    // Trim =fr= string from left side of the #value
    $form['field_description_fr']['#value'] = ltrim($form['field_description_fr']['#value'], '=fr=');
    // You might need to set the #default_value too
    $form['field_description_fr']['#default_value'] = ltrim($form['field_description_fr']['#default_value'], '=fr=');

    // Do this for each language... 
    // $form['field_description_de']['#value'] = .......


    $form['#submit'][] = 'language_markers_submit_handler_function';
  }
}

function language_markers_submit_handler_function($form, &amp;$form_state) {
  // Note the ampersand before $value below, which allows the
  // modifications on $value to persist into $form_state
  foreach($form_state['values'] as $field_name =&gt; &amp;$value) {
    switch($field_name) {
      case 'field_description_fr':
        $value = '=fr= '.$value;
        break;
      case 'field_description_nl':
        $value = '=nl= '.$value;
        break;
      case 'field_description_en':
        $value = '=en= '.$value;
        break;
    }
  }
}


In my opinion, this would quickly turn very unmaintainable as you get more and more fields &amp; languages combinations. So if you are planning to have more than these description fields, I would suggest to use more general ways to find these fields and automatically remove/add the language strings. For example, using hook_field_attach_presave