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 8286809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:52:37+00:00 2026-06-08T11:52:37+00:00

I am trying to localize my strings by creating an xml file for each

  • 0

I am trying to localize my strings by creating an xml file for each language then using ajax get like so.

var text = new Object();
$.ajax({
        async: false,
        type: 'GET',
        url: 'english.xml',
        dataType: "xml",
        error: function(xhr, status, error) {
              console.log("Lets see the error...");
              console.log(xhr.responseText);
        },
        success: function(xml){
                $(xml).find('text').each(function(){
                        text[$(this).attr('id')] = $(this).text();
                });
        }
});
console.log("Lets see the object...");
console.log(text);

I have added some console.logs to troubleshoot.
Here is a screenshot of the console.
console

So you see for some reason the request has failed.. any idea why?

english.xml simply contains:

<text id="call">Caller</text>
<text id="chat">Chatter</text>

Update:
Changed datatype to text and now getting success response but the ‘text’ object is not getting updated ?

var text = new Object();
$.ajax({
        type: 'GET',
        url: 'english.xml',
        dataType: "text",
        error: function(xhr, status, error) {
              console.log(xhr);
              console.log(xhr.responseText);
              console.log(status);
              console.log(error);
        },
        success: function(xml){
                $(xml).find('text').each(function(){
                        text[$(this).attr('id')] = $(this).text();
                });
                console.log(xml);
                console.log(text);
        }
});
  • 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-08T11:52:38+00:00Added an answer on June 8, 2026 at 11:52 am

    I would add

    <?xml version="1.0" encoding="utf-8"?>
    

    to the top of your document. I have a feeling since your telling it your return type will be xml it is expecting this and erroring when it doesnt find it.

    Also shouldn’t your response type be "application/xml" rather than just "xml" ?

    Also you have async set to false, this means you are asking for a synchronous call. Just incase you were wondering

    EDIT: I have edited since application/xml should really be used instead of text/xml

    You also need to have a root node

    <applicationCalls>
        <text id="call">Caller</text>
        <text id="chat">Chatter</text>
    </applicationCalls>
    

    You can call your root node whatever you like, just try and make it something that makes sense.

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

Sidebar

Related Questions

Trying to get a wildcard search to pick up on any text in org_name
I'm trying to use RegEx to select all strings between two dollar signs. text
I'm trying to do a replace of all instances of strings like PageLocalize(Texts, R73)
I'm trying to localize a large MFC project where all the strings are hard-coded
Greetings all, I'm trying to localize a .NET/C# project. I'm using string resource files
I'm trying to localize my strings in Xcode 4, but the only thing I
Trying to settle a debate with a client. I didnt localize the strings and
I'd like to localize my application with the following pattern: Localize all strings (say
I have been working on mvc3 application and trying to localize the same. I
I'm facing a strange issue, I'm trying to localize a website, so i converted

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.