Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a webpage with Index activated. I have this: enter image description here

Is there any way for change language of this, using .htaccess?

I've already tried this Directives:

AddLanguage pt .pt
DefaultLanguage pt-PT
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Language} ^.*(pt).*$ [NC]
RewriteRule ^(.*)$ - [env=lang:%1]
share|improve this question

2 Answers 2

As you already guessed you can use jQuery to change the styling and other things like labels. However there is a better way and that is changing Apache's index template files. This can be done easily in the .htaccess file by using HeaderName and ReadmeName see below.

To use your own header and footer files you can use:

IndexOptions +SuppressHTMLPreamble
HeaderName /includes/header.html
ReadmeName /includes/footer.html

You could also opt to use a Directory Listing template that has been made by other people that will save you time:

  1. H5ai
  2. Apaxy
  3. Indices
  4. Mabishu Apache Autoindex
  5. Repos Style

Alternatively you could check out this quality guide on making your own Directory Listing template in several easy steps.

share|improve this answer
    
I dunno how this could helps. You mentioned the way to declare header and footer, but this will not change language values of Apache's tabs (Name, Size, Description, Last Modified) :) –  fiskolin Apr 23 at 13:47
    
The header and footer was a mere example to get you started. There is actually a few ways you can edit the values, through making your own index.php file (the content that is in the middle of the header and footer) as well as a xsl method that the ResposStyle uses. Take a look at Respos your see that the labels are there own, but all examples can be altered to meet your needs. –  bybe Apr 23 at 14:06
up vote 1 down vote accepted

Foud a way using jQuery .replace:

$(document).ready(function(){
   $('body table tbody tr th a').each(function(i){ // THE OBJECT WHERE IS THE REPLACEING TEXT
        $(this).html($(this).html().replace('Name','LOREN IPSUN'));
        $(this).html($(this).html().replace('Last modified','LOREN IPSUN'));
        $(this).html($(this).html().replace('Size','LOREN IPSUN'));
        $(this).html($(this).html().replace('Description','LOREN IPSUN'));
   });
});

Just change loren ipsun for whatever you want.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.