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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:09:01+00:00 2026-06-14T18:09:01+00:00

Not sure about how to title this post. I just inherited a set of

  • 0

Not sure about how to title this post.

I just inherited a set of internationalization documents, each containing an array of key value pairs. I recognize the methodology is not ideal, it is however, what I’m stuck with given my role, the time and resources I have available. These lists were created by hand and items were constantly being added haphazardly to keep up with demand. The examples below are simplified, there are ~21 language files, each with 100+ entries.

The array from one file will have elements something like the below:

'download_high' => 'Vysoké',
'download_low' => 'Nízké',
'download_med' => 'Strední',
'download_video' => 'Stáhnout video',

While another file will have something like the following:

'download_video' => 'Descargar Video',
'download_high' => 'Alta',
'download_med' => 'Media',
'download_low' => 'Baja',

For the most part, the elements are ordered consistently, but there are plenty of exceptions and it complicates maintaining the files. I was wondering if there’s a way to make the order / formatting of these arrays consistent either via an IDE or notepad++ plugin, etc. I don’t want to order them alphabetically necessarily as there are logical groupings that won’t translate well to alphabetical sorting since only some of the variables are namespaced. Doing it by hand is almost out of the question, but it would be nice if there were some way to specify an order and have some kind of text manipulation tool batch process the files. I’m not all that familiar with php, so I don’t know that it would be worth it for me to do this via code unless it’s very simple.

  • 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-14T18:09:02+00:00Added an answer on June 14, 2026 at 6:09 pm

    Given the situation I’d do it semi-automatically on an as-needed basis. That is, it sounds to me like you’re charged with maintaining these files, and it’s in the maintenance that the sorting becomes an issue.

    For each language file formatted like:

    <?php
    $something = array(
      'download_video' => 'Descargar Video',
      'download_high' => 'Alta',
      ...
      'download_med' => 'Media',
      'download_low' => 'Baja',
    );
    
    1. Issue a sort lang.es.php command in bash, or via however you prefer to sort something.
    2. Open the file for editing.
    3. Delete the array declaration.
    4. Copy/paste the sorted lines from #1.

    Honestly, it was a super bad idea for your predecessor to effectively hard-code something like this. It would be much better if this were stored via CSV, XML, pg/mySQL, etc where you could at least invoke an editor that understands the data format.

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

Sidebar

Related Questions

I'm sorry about the title I'm just not sure how to describe this one.
I'm not even sure about how to title this qn. But, hope there is
Maybe the title was not quite exact since I am not sure about how
Just when I was about to post this question, I came up with an
Not sure if this is the correct title for this, so if its not
I am not sure about how NSSet's anyObject work. What does it mean that
I am not sure about the exact purpose of the following Rampion's code .
I am not sure about some things in OOP. If I have Class1 ,
I'm not sure about clarity of the STAR word. I'm implementing a search method
I'm not sure about one thing. There are two things in object oriented programming.

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.