Polyglot Plugin for WAI
[ Plugin / Polyglot Plugin for WAI / Leave Comment ]
On this page… (hide)
1. Download and Example
- Plugin URL (ver. 2.0 - beta)
2. What kind of WAI?
- Please check Web Content Accessibility Guidelines 1.0 Priority 2 - 13.1.2
- All Anchor elements are required not to use the same link text to refer to different resources.
3. Modify
- Edit file :
polyglot.php - Add
<span class=\"none\"> for \"".$post→post_title."\"</span>into link- find this function
function polyglot_other_langs
then you can find this linesforeach ($match as $lang){ if ($polyglot_settings['lang_pref'] != $lang) { $foo = ($polyglot_settings['use_flags'] ) ? "<img src=\"".$polyglot_settings['path_to_flags'].$polyglot_settings['flags'][$lang] ."\" alt=\"".get_trans($lang)."\" title=\"".get_trans($lang)."\" />" : get_trans($lang); $other_langs .= "$pre<a href='".get_permalink(); if ($polyglot_settings['lang_rewrite']) { if($polyglot_settings['i_have_manually_edited_my_htaccess_file'] || strpos(get_permalink(),'?') === false){ $other_langs .= "{$uri_helper}{$lang}/"; } else { $other_langs .= "&lang_view=$lang'"; } } else { if(strpos(get_permalink(),'?') === false){ $other_langs .= "?lang_view=$lang'"; } else { $other_langs .= "&lang_view=$lang'"; } } $other_langs .= "'>{$foo}</a>$afters"; } }And change like thisforeach ($match as $lang){ if ($polyglot_settings['lang_pref'] != $lang) { $foo = ($polyglot_settings['use_flags'] ) ? "<img src=\"".$polyglot_settings['path_to_flags'].$polyglot_settings['flags'][$lang] ."\" alt=\"".get_trans($lang)."\" title=\"".get_trans($lang)."\" />" : get_trans($lang)."<span class=\"none\"> for \"".$post->post_title."\"</span>" ; $other_langs .= "<li class='$lang'><a href='".get_permalink(); if ($polyglot_settings['lang_rewrite']) { if($polyglot_settings['i_have_manually_edited_my_htaccess_file'] || strpos(get_permalink(),'?') === false){ $other_langs .= "{$uri_helper}{$lang}/"; } else { $other_langs .= "&lang_view=$lang'"; } } else { if(strpos(get_permalink(),'?') === false){ $other_langs .= "?lang_view=$lang'"; } else { $other_langs .= "&lang_view=$lang'"; } } $other_langs .= "' title=\"".get_trans($lang)." for '".$post->post_title."'\">{$foo}</a>$afters"; } }And add style in CSS file like this.none {display:none;}
- find this function
- Result
If you wrote post with multi languages (Korean and English and Japanese) and you don't use flag for language links. the html code will be like this<ul> <li><a href="URL/lang/en/" title="English for 'Subject of Post'">English<span class="none"> for "Subject of Post'"</span></a></li> <li><a href="URL/lang/ko/" title="Korean for 'Subject of Post'">Korean<span class="none"> for "Subject of Post'"</span></a></li> <li><a href="URL/lang/ja/" title="Japanese for 'Subject of Post'">Japanese<span class="none"> for "Subject of Post'"</span></a></li> </ul>
And it will be shown like this
4. Related Links
- Plugin URL
- Web Content Accessibility Guidelines 1.0 Priority 2 -13.1.2
Categories : Wordpress
Search
Recent Changes
Groups
Related pages
- Feed Filter
- Jump Page Link with page name Plugin
- Modifying Table of Contents Plugin for Webstandard
- Plugin
- Pmwiki Comment Plugin for Diary Page
- Simple Code Escape
- Star Rating Plugin for PNG-24 Alpha Transparency
- Subscribe to Comments
- Title Plugins for WAI and Convenience
- Xspf Player 비교와 임시 수정
- 구글 스프레드 시트를 위키에 가져오기
- 위키 액션에 권한주기
- 철저하게 웹표준을 지키는 방법
- 코멘트 Allow Tags
- 코멘트 타입 구분 나열
- 토글 플러그인