Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
homepage re-design: fix default language detection; add footer
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaber committed Dec 19, 2013
1 parent 7889ac7 commit a4f2abd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion include/checkform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
function printLangOption($langCode) {
global $checkDefaultLang;
global $checkLanguage;

//print "checkDefaultLang: $checkDefaultLang";

$checked = ($langCode == $checkDefaultLang) ? " selected='selected'" : "";
if (strpos($langCode, '-') >= 0) {
// e.g. de-DE
$shortLangCode = substr($langCode, 0, strpos($langCode, '-'));
$checked = ($shortLangCode == $checkDefaultLang) ? " selected='selected'" : "";
} else {
$checked = ($langCode == $checkDefaultLang) ? " selected='selected'" : "";
}

if (isset($checkLanguage[$langCode])) {
// User defined translation.
Expand Down
2 changes: 1 addition & 1 deletion include/partials/stage_head.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?php
$checkSubmitButtonValue = "Check Text";
$showLanguageBox = 1;
$checkDefaultLang = "en-US";
//$checkDefaultLang = "en-US";
$checkDefaultText = "Paste your own text here... or check this text too see an few of of the problems that LanguageTool can detecd.";
include("../include/checkform.php");
?>
Expand Down
2 changes: 1 addition & 1 deletion www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

$languagesWithPage = array("br", "ca", "zh", "eo", "fr", "de", "it", "pl", "ru", "pt");
$languageNamesWithPage = array("Breton", "Catalan", "Chinese", "Esperanto", "French", "German", "Italian", "Polish", "Russian", "Portuguese");
$defaultLang = getDefaultLanguage();
$checkDefaultLang = getDefaultLanguage();

$currentLang = 'en';

Expand Down
2 changes: 2 additions & 0 deletions www/support/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@

</div>

<?php include("../../include/footer.php"); ?>

</body>
</html>

0 comments on commit a4f2abd

Please sign in to comment.