aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
authorSimounet <contact@simounet.net>2019-01-11 21:09:49 +0100
committerSimounet <contact@simounet.net>2020-01-23 21:21:54 +0100
commit416d44d0aef68b04aec90d207e33feb68706e1c3 (patch)
treef304459c29a6c69a9f445377d6c11d9a379923bc /src/Wallabag/CoreBundle/Entity
parent7937ed0c20ca0df493c775e93a3294aeb5f7da26 (diff)
downloadwallabag-416d44d0aef68b04aec90d207e33feb68706e1c3.tar.gz
wallabag-416d44d0aef68b04aec90d207e33feb68706e1c3.tar.zst
wallabag-416d44d0aef68b04aec90d207e33feb68706e1c3.zip
Use lang attribute
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index beda581a..19045798 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -788,6 +788,19 @@ class Entry
788 } 788 }
789 789
790 /** 790 /**
791 * Format the entry language to a valid html lang attribute.
792 */
793 public function getHTMLLanguage()
794 {
795 $parsedLocale = \Locale::parseLocale($this->getLanguage());
796 $lang = '';
797 $lang .= $parsedLocale['language'] ?? '';
798 $lang .= isset($parsedLocale['region']) ? '-' . $parsedLocale['region'] : '';
799
800 return $lang;
801 }
802
803 /**
791 * @return string|null 804 * @return string|null
792 */ 805 */
793 public function getUid() 806 public function getUid()