Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language_attributes() in header.php #37

Closed
bjornjohansen opened this issue Apr 27, 2011 · 5 comments
Closed

language_attributes() in header.php #37

bjornjohansen opened this issue Apr 27, 2011 · 5 comments

Comments

@bjornjohansen
Copy link

A small issue, but if the lang="en" attributes in header.php could be replaced with lang="" the theme would be more compatible with non-English web sites:

<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="<?php language_attributes(); ?>"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7" lang="<?php language_attributes(); ?>"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8" lang="<?php language_attributes(); ?>"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="<?php language_attributes(); ?>"> <!--<![endif]-->
<head>
@retlehs
Copy link
Member

retlehs commented Apr 27, 2011

doing that makes it spit out lang="en-US" rather than lang="en" i believe which is why i didn't originally do it

will look into this further, and also we'll be implementing #24 soon

thanks for the issue

@bjornjohansen
Copy link
Author

Well, if "en-US" isn't what you want, you probably should edit the constant WPLANG in your wp-config.php.

Thanks for the good work BTW. Just reading the documentation was a joy :-)

@swalkinshaw
Copy link
Member

en-US is actually a valid language code: http://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1

I'm assuming there wouldn't be much real world difference between "en" and "en-US" since the primary code is still the same.

@philipashlock
Copy link

Why is "en-US" converted to "en" when it is a valid language code (as @swalkinshaw said) and is based on what is already properly set by (or defaulted to by) WPLANG?

I also don't understand why dir="rtl" is added if applicable, but dir="ltr" is not

Furthermore, it doesn't look like is_rtl() is used properly since it's only supposed to return a boolean - http://codex.wordpress.org/Function_Reference/is_rtl

@swalkinshaw
Copy link
Member

@philipashlock thanks for bringing this up again. See #942 for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants