* Outputs all the language IDs and strings * to an HTML table. * @param filename HTML file. */
| 540 | * @param filename HTML file. |
| 541 | */ |
| 542 | void Language::toHtml(const std::string &filename) const |
| 543 | { |
| 544 | std::ofstream htmlFile (filename.c_str(), std::ios::out); |
| 545 | htmlFile << "<table border=\"1\" width=\"100%\">" << std::endl; |
| 546 | htmlFile << "<tr><th>ID String</th><th>English String</th></tr>" << std::endl; |
| 547 | for (std::map<std::string, LocalizedText>::const_iterator i = _strings.begin(); i != _strings.end(); ++i) |
| 548 | { |
| 549 | htmlFile << "<tr><td>" << i->first << "</td><td>"; |
| 550 | std::string s = wstrToUtf8(i->second); |
| 551 | for (std::string::const_iterator j = s.begin(); j != s.end(); ++j) |
| 552 | { |
| 553 | if (*j == 2 || *j == '\n') |
| 554 | { |
| 555 | htmlFile << "<br />"; |
| 556 | } |
| 557 | else |
| 558 | { |
| 559 | htmlFile << *j; |
| 560 | } |
| 561 | } |
| 562 | htmlFile << "</td></tr>" << std::endl; |
| 563 | } |
| 564 | htmlFile << "</table>" << std::endl; |
| 565 | htmlFile.close(); |
| 566 | } |
| 567 | |
| 568 | /** |
| 569 | * Returns the direction to use for rendering |