sahwar

internationalized-HTML5-converter_fix1.html

Oct 18th, 2014
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 11.63 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <title>Internationalized HTML(5) converter (write HTML(5) in your own native language and output it automagically into proper English code!</title>
  5. </head>
  6. <body>
  7. <!--
  8. This code is made possible by:
  9. 1. PHP code copied from http://stackoverflow.com/questions/535143/search-and-replace-multiple-values-with-multiple-different-values-in-php5
  10. 2. Some code copied from http://stackoverflow.com/questions/7711466/checking-if-form-has-been-submitted-php
  11. 3. http://bg2.php.net/str_replace
  12. 4. Help from a friend who knows PHP.
  13. 5. The HTML tags are acquired from http://www.w3schools.com/tags/default.asp
  14. 6. The CSS tags are acquired from http://www.w3schools.com/cssref/
  15. -->
  16. <p style="text-align: center;"><strong>Internationalized HTML(5) converter (write HTML(5) in your own native language and output it automagically into proper English code!</strong></p>
  17. <form method="post" action="<?php echo $PHP_SELF;?>" style="text-align: center;">
  18. <textarea rows="10" cols="50" name="quote" wrap="physical" style="text-align: center;">Enter your input code here!</textarea><br />
  19. Select the HTML's/CSS's language input-output type:<br />
  20. <select name="transformation" style="text-align: center;">
  21. <option value="BGEN">BG → EN</option>
  22. <option value="ENBG">EN → BG</option>
  23. </select><br />
  24. <input type="submit" value="submit" name="submit" style="text-align: center;">
  25. </form>
  26. <p style="text-align: center;">Your output code goes here! Just copy and paste into Notepad and save it as an UTF-8-encoded *.html<p>
  27. <textarea rows="10" cols="50" name="result" wrap="physical" style="text-align: center;">
  28.  
  29. <?php
  30.  
  31. if (!empty($_POST))
  32. {
  33. $quote = $_POST["quote"];
  34. $searchReplaceArray = array(
  35.  '<!ТИПНАДОК емхт>' => '<!DOCTYPE html>',
  36.   '<емхт>' => '<html>',
  37.   '</емхт>' => '</html>',
  38.   '<к хпре=' => '<a href=',
  39.  '</к>' => '</a>',
  40.   '<абр>' => '<abbr>',
  41.   '<акроним заглавие=' => '<acronym title=',
  42.  '</акроним>' => '</acronym>',
  43.   '<адрес>' => '<address>',
  44.   '</адрес>' => '</address>',
  45.   '<абр заглавие=' => '<abbr title=',
  46.  '</абр>' => '</abbr>',
  47.   '<аплет код="' => '<applet code="',
  48.  '</аплет>' => '</applet>',
  49.   ' ширина="' => ' width="'
  50.   ' височина="' => ' height="'
  51.   '<зона очертание=">' => ' <area shape=">',
  52.   '</зона>' => '</area>',
  53.   ' координати="' => ' coords="',
  54.   ' хпреп="' => ' href="',
  55.   ' алт="' => ' alt="',
  56.   '<статия>' => '<article>',
  57.   '</статия>' => '</article>',
  58.   '<настрана>' => '<aside>',
  59.   '</настрана>' => '</aside>',
  60.   '<аудио>' => '<audio>',
  61.   '</аудио>' => '</audio>',
  62.   ' контроли ' => ' controls ',
  63.   '<източник изт="' => '<source src="',
  64.  '</източник>' => '</source>',
  65.   ' затворена верига ' => ' loop ',
  66.   ' заглушаване ' => ' muted ',
  67.   'предзареждане="' => 'preload="',
  68.   'изт="' => 'src="',
  69.   '<пч>' => '<b>',
  70.   '</пч>' => '</b>',
  71.   '<основа ' => '<base ',
  72.  '</основа>' => '</base>',
  73.   ' цел="' => ' target="',
  74.   '<основеншрифт ' => '<basefont ',
  75.  '</основеншрифт>' => '</basefont>',
  76.   ' цвят="' => ' color="',
  77.   ' начертание="' => ' face="',
  78.   ' размер="' => ' size="',
  79.   '<дпи>' => '<bdi>',
  80.   '</дпи>' => '</bdi>',
  81.   '<дпп посока="' => '<bdo dir="',
  82.  '</дпп>' => '</bdo>',
  83.   '<голям>' => '<big>',
  84.   '</голям>' => '</big>',
  85.   '<блокцитат>' => '<blockquote>',
  86.   '<блокцитат цитиране=' => '<blockquote cite="',
  87.  '</блокцитат>' => '</blockquote>',
  88.   '<тяло>' => '<body>',
  89.   '</тяло>' => '</body>',
  90.   ' авръзка="' => ' alink="',
  91.   ' фон="' => ' background="',
  92.   ' фоновцвят="' => ' bgcolor="',
  93.   ' връзка="' => ' link="',
  94.   ' текст="' => ' text="',
  95.   ' пвръзка="' => ' vlink="',
  96.   '<чл>' => '<br>',
  97.   '<чл />' => '<br />',
  98.   '<чл/>' => '<br/>',
  99.   'blarh' => 'blerh',
  100.   'blarh' => 'blerh',
  101.   'blarh' => 'blerh',
  102.   'blarh' => 'blerh',
  103.   'blarh' => 'blerh',
  104.   'blarh' => 'blerh',
  105.   'blarh' => 'blerh',
  106.   'blarh' => 'blerh',
  107.   'blarh' => 'blerh',
  108.   'blarh' => 'blerh',
  109.   'blarh' => 'blerh',
  110.   'blarh' => 'blerh',
  111.   'blarh' => 'blerh',
  112.   'blarh' => 'blerh',
  113.   'blarh' => 'blerh',
  114.   'blarh' => 'blerh',
  115.   'blarh' => 'blerh',
  116.   'blarh' => 'blerh',
  117.   'blarh' => 'blerh',
  118.   'blarh' => 'blerh',
  119.   'blarh' => 'blerh',
  120.   'blarh' => 'blerh',
  121.   'blarh' => 'blerh',
  122.   'blarh' => 'blerh',
  123.   'blarh' => 'blerh',
  124.   'blarh' => 'blerh',
  125.   'blarh' => 'blerh',
  126.   'blarh' => 'blerh',
  127.   'blarh' => 'blerh',
  128.   'blarh' => 'blerh',
  129.   'blarh' => 'blerh',
  130.   'blarh' => 'blerh',
  131.   'blarh' => 'blerh',
  132.   'blarh' => 'blerh',
  133.   'blarh' => 'blerh',
  134.   'blarh' => 'blerh',
  135.   'blarh' => 'blerh',
  136.   'blarh' => 'blerh',
  137.   'blarh' => 'blerh',
  138.   'blarh' => 'blerh',
  139.   'blarh' => 'blerh',
  140.   'blarh' => 'blerh',
  141.   'blarh' => 'blerh',
  142.   'blarh' => 'blerh',
  143.   'blarh' => 'blerh',
  144.   'blarh' => 'blerh',
  145.   'blarh' => 'blerh',
  146.   'blarh' => 'blerh',
  147.   'blarh' => 'blerh',
  148.   'blarh' => 'blerh',
  149.   'blarh' => 'blerh',
  150.   'blarh' => 'blerh',
  151.   'blarh' => 'blerh',
  152.   'blarh' => 'blerh',
  153.   'blarh' => 'blerh',
  154.   'blarh' => 'blerh',
  155.   'blarh' => 'blerh',
  156.   'blarh' => 'blerh',
  157.   'blarh' => 'blerh',
  158.   'blarh' => 'blerh',
  159.   'blarh' => 'blerh',
  160.   'blarh' => 'blerh',
  161.   'blarh' => 'blerh',
  162.   'blarh' => 'blerh',
  163.   'blarh' => 'blerh',
  164.   'blarh' => 'blerh',
  165.   'blarh' => 'blerh',
  166.   'blarh' => 'blerh',
  167.   'blarh' => 'blerh',
  168.   'blarh' => 'blerh',
  169.   'blarh' => 'blerh',
  170.   'blarh' => 'blerh',
  171.   'blarh' => 'blerh',
  172.   'blarh' => 'blerh',
  173.   'blarh' => 'blerh',
  174.   'blarh' => 'blerh',
  175.   'blarh' => 'blerh',
  176.   'blarh' => 'blerh',
  177.   'blarh' => 'blerh',
  178.   'blarh' => 'blerh',
  179.   'blarh' => 'blerh',
  180.   'blarh' => 'blerh',
  181.   'blarh' => 'blerh',
  182.   'blarh' => 'blerh',
  183.   'blarh' => 'blerh',
  184.   'blarh' => 'blerh',
  185.   'blarh' => 'blerh',
  186.   'blarh' => 'blerh',
  187.   'blarh' => 'blerh',
  188.   'blarh' => 'blerh',
  189.   'blarh' => 'blerh',
  190.   'blarh' => 'blerh',
  191.   'blarh' => 'blerh',
  192. );
  193. if ($_POST["transformation"] == "BGEN") {
  194. $result = str_replace(
  195.   array_keys($searchReplaceArray),
  196.   array_values($searchReplaceArray),
  197.   $quote
  198. );
  199. } else {
  200. $result = str_replace(
  201.   array_values($searchReplaceArray),
  202.   array_keys($searchReplaceArray),
  203.   $quote
  204. );
  205. }
  206.  
  207.  echo $result;
  208.  
  209. }
  210. ?>
  211. </textarea>
  212.  
  213. <p>
  214. <code>
  215. <button>    Defines a clickable button
  216. <canvas>    Used to draw graphics, on the fly, via scripting (usually JavaScript)
  217. <caption>   Defines a table caption
  218. <center>    Not supported in HTML5. Use CSS instead. Defines centered text
  219. <cite>  Defines the title of a work
  220. <code>  Defines a piece of computer code
  221. <col>   Specifies column properties for each column within a <colgroup> element
  222. <colgroup>  Specifies a group of one or more columns in a table for formatting
  223. <datalist>  Specifies a list of pre-defined options for input controls
  224. <dd>    Defines a description/value of a term in a description list
  225. <del>   Defines text that has been deleted from a document
  226. <details>   Defines additional details that the user can view or hide
  227. <dfn>   Defines a definition term
  228. <dialog>    Defines a dialog box or window
  229. <dir>   Not supported in HTML5. Use <ul> instead.
  230. Defines a directory list
  231. <div>   Defines a section in a document
  232. <dl>    Defines a description list
  233. <dt>    Defines a term/name in a description list
  234. <em>    Defines emphasized text
  235. <embed>     Defines a container for an external (non-HTML) application
  236. <fieldset>  Groups related elements in a form
  237. <figcaption>    Defines a caption for a <figure> element
  238. <figure>    Specifies self-contained content
  239. <font>  Not supported in HTML5. Use CSS instead.
  240. Defines font, color, and size for text
  241. <footer>    Defines a footer for a document or section
  242. <form>  Defines an HTML form for user input
  243. <frame>     Not supported in HTML5.
  244. Defines a window (a frame) in a frameset
  245. <frameset>  Not supported in HTML5.
  246. Defines a set of frames
  247. <h1> to <h6>    Defines HTML headings
  248. <head>  Defines information about the document
  249. <header>    Defines a header for a document or section
  250. <hr>    Defines a thematic change in the content
  251. <html>  Defines the root of an HTML document
  252. <i>     Defines a part of text in an alternate voice or mood
  253. <iframe>    Defines an inline frame
  254. <img>   Defines an image
  255. <input>     Defines an input control
  256. <ins>   Defines a text that has been inserted into a document
  257. <kbd>   Defines keyboard input
  258. <keygen>    Defines a key-pair generator field (for forms)
  259. <label>     Defines a label for an <input> element
  260. <legend>    Defines a caption for a <fieldset> element
  261. <li>    Defines a list item
  262. <link>  Defines the relationship between a document and an external resource (most used to link to style sheets)
  263. <main>  Specifies the main content of a document
  264. <map>   Defines a client-side image-map
  265. <mark>  Defines marked/highlighted text
  266. <menu>  Defines a list/menu of commands
  267. <menuitem>  Defines a command/menu item that the user can invoke from a popup menu
  268. <meta>  Defines metadata about an HTML document
  269. <meter>     Defines a scalar measurement within a known range (a gauge)
  270. <nav>   Defines navigation links
  271. <noframes>  Not supported in HTML5.
  272. Defines an alternate content for users that do not support frames
  273. <noscript>  Defines an alternate content for users that do not support client-side scripts
  274. <object>    Defines an embedded object
  275. <ol>    Defines an ordered list
  276. <optgroup>  Defines a group of related options in a drop-down list
  277. <option>    Defines an option in a drop-down list
  278. <output>    Defines the result of a calculation
  279. <p>     Defines a paragraph
  280. <param>     Defines a parameter for an object
  281. <pre>   Defines preformatted text
  282. <progress>  Represents the progress of a task
  283. <q>     Defines a short quotation
  284. <rp>    Defines what to show in browsers that do not support ruby annotations
  285. <rt>    Defines an explanation/pronunciation of characters (for East Asian typography)
  286. <ruby>  Defines a ruby annotation (for East Asian typography)
  287. <s>     Defines text that is no longer correct
  288. <samp>  Defines sample output from a computer program
  289. <script>    Defines a client-side script
  290. <section>   Defines a section in a document
  291. <select>    Defines a drop-down list
  292. <small>     Defines smaller text
  293. <source>    Defines multiple media resources for media elements (<video> and <audio>)
  294. <span>  Defines a section in a document
  295. <strike>    Not supported in HTML5. Use <del> instead.
  296. Defines strikethrough text
  297. <strong>    Defines important text
  298. <style>     Defines style information for a document
  299. <sub>   Defines subscripted text
  300. <summary>   Defines a visible heading for a <details> element
  301. <sup>   Defines superscripted text
  302. <table>     Defines a table
  303. <tbody>     Groups the body content in a table
  304. <td>    Defines a cell in a table
  305. <textarea>  Defines a multiline input control (text area)
  306. <tfoot>     Groups the footer content in a table
  307. <th>    Defines a header cell in a table
  308. <thead>     Groups the header content in a table
  309. <time>  Defines a date/time
  310. <title>     Defines a title for the document
  311. <tr>    Defines a row in a table
  312. <track>     Defines text tracks for media elements (<video> and <audio>)
  313. <tt>    Not supported in HTML5. Use CSS instead.
  314. Defines teletype text
  315. <u>     Defines text that should be stylistically different from normal text
  316. <ul>    Defines an unordered list
  317. <var>   Defines a variable
  318. <video>     Defines a video or movie
  319. <wbr>   Defines a possible line-break
  320. </code>
  321. </p>
  322.  
  323. <p>For comments and suggestions, please write to <a href="mailto:[email protected]">[email protected]</a>.<br/>
  324. The GitHub page of this script is <a href="http://github.com/sahwar/">http://github.com/sahwar/</a></p>
  325. </body>
  326. </html>
Advertisement
Add Comment
Please, Sign In to add comment