prism-gettext.js 720 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Prism.languages.gettext = {
  2. 'comment': [
  3. {
  4. pattern: /# .*/,
  5. greedy: true,
  6. alias: 'translator-comment'
  7. },
  8. {
  9. pattern: /#\..*/,
  10. greedy: true,
  11. alias: 'extracted-comment'
  12. },
  13. {
  14. pattern: /#:.*/,
  15. greedy: true,
  16. alias: 'reference-comment'
  17. },
  18. {
  19. pattern: /#,.*/,
  20. greedy: true,
  21. alias: 'flag-comment'
  22. },
  23. {
  24. pattern: /#\|.*/,
  25. greedy: true,
  26. alias: 'previously-untranslated-comment'
  27. },
  28. {
  29. pattern: /#.*/,
  30. greedy: true
  31. },
  32. ],
  33. 'string': {
  34. pattern: /(^|[^\\])"(?:[^"\\]|\\.)*"/,
  35. lookbehind: true,
  36. greedy: true
  37. },
  38. 'keyword': /^msg(?:ctxt|id|id_plural|str)\b/m,
  39. 'number': /\b\d+\b/,
  40. 'punctuation': /[\[\]]/
  41. };
  42. Prism.languages.po = Prism.languages.gettext;