diff options
author | Jacek Antonelli | 2008-08-15 23:45:14 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:14 -0500 |
commit | 075b5b41dcf4be2c33a4473889fefcbffb1a8fe5 (patch) | |
tree | 945b9c3a40691e01cd67f6f94324f8b3ded61574 /linden/indra/llui | |
parent | Second Life viewer sources 1.18.4.1-RC (diff) | |
download | meta-impy-075b5b41dcf4be2c33a4473889fefcbffb1a8fe5.zip meta-impy-075b5b41dcf4be2c33a4473889fefcbffb1a8fe5.tar.gz meta-impy-075b5b41dcf4be2c33a4473889fefcbffb1a8fe5.tar.bz2 meta-impy-075b5b41dcf4be2c33a4473889fefcbffb1a8fe5.tar.xz |
Second Life viewer sources 1.18.4.2-RC
Diffstat (limited to 'linden/indra/llui')
-rw-r--r-- | linden/indra/llui/llui.cpp | 101 | ||||
-rw-r--r-- | linden/indra/llui/llui.h | 3 |
2 files changed, 0 insertions, 104 deletions
diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index 1d2d8a7..7af0d72 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp | |||
@@ -67,7 +67,6 @@ const LLColor4 UI_VERTEX_COLOR(1.f, 1.f, 1.f, 1.f); | |||
67 | BOOL gShowTextEditCursor = TRUE; | 67 | BOOL gShowTextEditCursor = TRUE; |
68 | 68 | ||
69 | // Language for UI construction | 69 | // Language for UI construction |
70 | LLString gLanguage = "english-usa"; | ||
71 | std::map<LLString, LLString> gTranslation; | 70 | std::map<LLString, LLString> gTranslation; |
72 | std::list<LLString> gUntranslated; | 71 | std::list<LLString> gUntranslated; |
73 | 72 | ||
@@ -1515,104 +1514,6 @@ void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3 | |||
1515 | gl_segmented_rect_3d_tex(border_scale, border_width, border_height, width_vec, height_vec, ROUNDED_RECT_TOP); | 1514 | gl_segmented_rect_3d_tex(border_scale, border_width, border_height, width_vec, height_vec, ROUNDED_RECT_TOP); |
1516 | } | 1515 | } |
1517 | 1516 | ||
1518 | #if 0 // No longer used | ||
1519 | void load_tr(const LLString& lang) | ||
1520 | { | ||
1521 | LLString inname = "words." + lang + ".txt"; | ||
1522 | LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, inname.c_str()); | ||
1523 | |||
1524 | llifstream file; | ||
1525 | file.open(filename.c_str(), std::ios_base::binary); /* Flawfinder: ignore */ | ||
1526 | if (!file) | ||
1527 | { | ||
1528 | llinfos << "No translation dictionary for: " << filename << llendl; | ||
1529 | return; | ||
1530 | } | ||
1531 | |||
1532 | llinfos << "Reading language translation dictionary: " << filename << llendl; | ||
1533 | |||
1534 | gTranslation.clear(); | ||
1535 | gUntranslated.clear(); | ||
1536 | |||
1537 | const S32 MAX_LINE_LEN = 1024; | ||
1538 | char buffer[MAX_LINE_LEN]; /* Flawfinder: ignore */ | ||
1539 | while (!file.eof()) | ||
1540 | { | ||
1541 | file.getline(buffer, MAX_LINE_LEN); | ||
1542 | LLString line(buffer); | ||
1543 | S32 commentpos = line.find("//"); | ||
1544 | if (commentpos != LLString::npos) | ||
1545 | { | ||
1546 | line = line.substr(0, commentpos); | ||
1547 | } | ||
1548 | S32 offset = line.find('\t'); | ||
1549 | if (offset != LLString::npos) | ||
1550 | { | ||
1551 | LLString english = line.substr(0,offset); | ||
1552 | LLString translation = line.substr(offset+1); | ||
1553 | //llinfos << "TR: " << english << " = " << translation << llendl; | ||
1554 | gTranslation[english] = translation; | ||
1555 | } | ||
1556 | } | ||
1557 | |||
1558 | file.close(); | ||
1559 | } | ||
1560 | |||
1561 | void init_tr(const LLString& language) | ||
1562 | { | ||
1563 | if (!language.empty()) | ||
1564 | { | ||
1565 | gLanguage = language; | ||
1566 | } | ||
1567 | load_tr(gLanguage); | ||
1568 | } | ||
1569 | |||
1570 | void cleanup_tr() | ||
1571 | { | ||
1572 | // Dump untranslated phrases to help with translation | ||
1573 | if (gUntranslated.size() > 0) | ||
1574 | { | ||
1575 | LLString outname = "untranslated_" + gLanguage + ".txt"; | ||
1576 | LLString outfilename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, outname.c_str()); | ||
1577 | llofstream outfile; | ||
1578 | outfile.open(outfilename.c_str()); /* Flawfinder: ignore */ | ||
1579 | if (!outfile) | ||
1580 | { | ||
1581 | return; | ||
1582 | } | ||
1583 | llinfos << "Writing untranslated words to: " << outfilename << llendl; | ||
1584 | LLString outtext; | ||
1585 | for (std::list<LLString>::iterator iter = gUntranslated.begin(); | ||
1586 | iter != gUntranslated.end(); ++iter) | ||
1587 | { | ||
1588 | // output: english_phrase english_phrase | ||
1589 | outtext += *iter; | ||
1590 | outtext += "\t"; | ||
1591 | outtext += *iter; | ||
1592 | outtext += "\n"; | ||
1593 | } | ||
1594 | outfile << outtext.c_str(); | ||
1595 | outfile.close(); | ||
1596 | } | ||
1597 | } | ||
1598 | |||
1599 | LLString tr(const LLString& english_string) | ||
1600 | { | ||
1601 | std::map<LLString, LLString>::iterator it = gTranslation.find(english_string); | ||
1602 | if (it != gTranslation.end()) | ||
1603 | { | ||
1604 | return it->second; | ||
1605 | } | ||
1606 | else | ||
1607 | { | ||
1608 | gUntranslated.push_back(english_string); | ||
1609 | return english_string; | ||
1610 | } | ||
1611 | } | ||
1612 | |||
1613 | #endif | ||
1614 | |||
1615 | |||
1616 | class LLShowXUINamesListener: public LLSimpleListener | 1517 | class LLShowXUINamesListener: public LLSimpleListener |
1617 | { | 1518 | { |
1618 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1519 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -1643,12 +1544,10 @@ void LLUI::initClass(LLControlGroup* config, | |||
1643 | 1544 | ||
1644 | LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames"); | 1545 | LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames"); |
1645 | LLUI::sConfigGroup->getControl("ShowXUINames")->addListener(&show_xui_names_listener); | 1546 | LLUI::sConfigGroup->getControl("ShowXUINames")->addListener(&show_xui_names_listener); |
1646 | // init_tr(language); | ||
1647 | } | 1547 | } |
1648 | 1548 | ||
1649 | void LLUI::cleanupClass() | 1549 | void LLUI::cleanupClass() |
1650 | { | 1550 | { |
1651 | // cleanup_tr(); | ||
1652 | } | 1551 | } |
1653 | 1552 | ||
1654 | 1553 | ||
diff --git a/linden/indra/llui/llui.h b/linden/indra/llui/llui.h index 4d831ca..b806f7a 100644 --- a/linden/indra/llui/llui.h +++ b/linden/indra/llui/llui.h | |||
@@ -144,9 +144,6 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, BOOL | |||
144 | // Used to hide the flashing text cursor when window doesn't have focus. | 144 | // Used to hide the flashing text cursor when window doesn't have focus. |
145 | extern BOOL gShowTextEditCursor; | 145 | extern BOOL gShowTextEditCursor; |
146 | 146 | ||
147 | // Language | ||
148 | extern LLString gLanguage; | ||
149 | |||
150 | class LLImageProviderInterface; | 147 | class LLImageProviderInterface; |
151 | typedef void (*LLUIAudioCallback)(const LLUUID& uuid); | 148 | typedef void (*LLUIAudioCallback)(const LLUUID& uuid); |
152 | 149 | ||