gnosygnu / xowa

xowa offline wiki application
Other
375 stars 41 forks source link

page <title> #715

Closed desb42 closed 4 years ago

desb42 commented 4 years ago

looking at the main page of enwikivoyage en.wikivoyage.org/wiki/Main_Page In mediawiki the \ is <code>Wikivoyage – The free worldwide travel guide that you can edit</code> whereas for xowa it is <code>Main Page - XOWA</code></p> <p>Similarly for any other page (as an example <code>Thimphu – Travel guide at Wikivoyage</code>) mediawiki \<title> is <code>Thimphu – Travel guide at Wikivoyage</code> and xowa is <code>Thimphu – XOWA</code></p> <p>This only becomes noticeable in xowa-http</p> <p>Researching, I have found two MediaWiki 'messages' that control this effect <code>MediaWiki:Pagetitle</code> -> <code>$1 – Travel guide at {{SITENAME}}</code> <code>MediaWiki:Pagetitle-view-mainpage</code> -> <code>{{SITENAME}} – The free worldwide travel guide that you can edit</code></p> <p>by modifying <code>400_xowa\src\gplx\xowa\htmls\Xoh_page_wtr_wkr.java</code> and adding these few lines just before the <code>fmtr.Bld_bfr_many</code></p> <pre><code>Xow_msg_mgr msg_mgr = wiki.Msg_mgr(); byte[] page_mask_msg = Bry_.new_a7("pagetitle"); if (Bry_.Eq(Xoa_ttl.Replace_unders(page.Ttl().Raw()), wiki.Props().Main_page())) page_mask_msg = Bry_.new_a7("pagetitle-view-mainpage"); page_name = msg_mgr.Val_by_key_args(page_mask_msg, page_name);</code></pre> <p>should make it work across all wikis</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gnosygnu"><img src="https://avatars.githubusercontent.com/u/4994104?v=4" />gnosygnu</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <p>Great detail as always!</p> <ul> <li>Made a few more changes than needed, but primarily because I wanted to clean the code a little and put it under tests.</li> <li>Also, made a 2nd fix commit b/c I didn't realize that the 1st commit was being wrong applied to GUI tabs also (it makes the SWT/GUI tab names very long)</li> </ul> <p>Let me know if anything else. Thanks!</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/desb42"><img src="https://avatars.githubusercontent.com/u/861631?v=4" />desb42</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <p>Looks good.</p> <p>Unfortunately, I cannot apply this fix in quite the same way I have made a number of changes to the 'page' generation over time (Xoh_page_wtr_wkr.java) Some of which are: 1) Add logic to display heading for wikidata (which is quite convoluted) 2) always display <code>Firstheader</code> - the css on page should cope with hiding it if necessary 3) commons has a Data: namespace - when .tab show a table 4) added a printfooter for a javascript hook in wikisource (and possibly other wikis)</p> <p>I realise that all these bits of code could be extracted into classes of their own. This is more of a playground for ideas that somehow need to be integrated into the main build</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/gnosygnu"><img src="https://avatars.githubusercontent.com/u/4994104?v=4" />gnosygnu</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>Some of which are:</p> <ol> <li>Add logic to display heading for wikidata (which is quite convoluted)</li> <li>always display Firstheader - the css on page should cope with hiding it if necessary</li> <li>commons has a Data: namespace - when .tab show a table</li> <li>added a printfooter for a javascript hook in wikisource (and possibly other wikis)</li> </ol> </blockquote> <p>Yeah, sorry, I'm sure I've been long overdue in responding to those issues. Feel free to bump any of them in priority (or just picking them from the list above) and I'll prioritize higher.</p> <p>Otherwise, thanks!</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>