This is a translation and annotation of the poem 卜居 (Bǔ Jū) by the Tang dynasty poet 杜甫 (Dù Fǔ). The translation aims to be literal and close to the original, not idiomatic.
卜居
bǔ jū
浣花溪水水西頭,
huǎn huā liú shuǐ shuǐ xī tóu
[_Huanhua_][] [flow] [water] [water] [west] [head]
The Huanhua flows into the waters in the western corner
_浣花 is a lake and river; 水 is most likely doubled just to emphasise the image of flowing water._
主人為卜林塘幽。
zhǔ rén wèi bǔ lín táng yōu
[master] [person] [do] [divine] [trees] [embankment] [secluded]
The master performs divination, choosing a grove on a bank, secluded
_This master may be a monk from a temple, hired to make 風水 analysis for the site of a new home. 居 could also refer to positioning yourself on a general decision._
已知出郭少塵事,
yǐ zhī chū guó shǎo chén shì
[already] [know] [go out] [wall] [reduce] [earthly] [matter]
One knew to leave the city walls to reduce earthly matters
_This line is hard to translate closely whilst producing reasonable English. It's about getting out of the city to escape worldly concerns._
更有澄江消客愁。
gēng yǒu chéng jiāng ciāo kè chóu
[further] [have] [pure] [river] [dispel] [traveller] [worry]
Yet further there is the pure river, dispelling the traveller's worries
_The implication here may be that leaving the city does not compare to coming to this remote place._
無數蜻蜓齊上下,
wú shù qīng tíng qí shàng xià
[without] [number] [dragonfly][] [together] [rise] [fall]
Without number, dragonflies together rise and fall
_This could be an analogy for factions in the imperial court. This is suggested more strongly by the selection of 蜓 for 'dragonfly', as this character contains 廷, which means 'royal courtyard'._
一雙鸂鶒對沉浮。
yī shuāng xī chì duì chén fú
[one] [pair] [water fowl][] [face] [sink] [float]
A pair of water fowl face each other diving and floating
_These water fowl may be mandarin ducks, which are frequently used as an image of loyalty. There is another reference to the imperial court here, with the selection of 鶒, which contains 勅 - 'imperial decree'._
東行萬裏堪乘興,
dōng xíng wàn lǐ kān chéng xìng
[east] [travel] [ten thousand] [mile] [endure] [ride] [inspiration]
To the east, travelling ten thousand miles, enduring by riding the inspiration
_This is likely about trying to maintain motivation to join 'the rat race' of imperial life. 乘興 refers to an old story about travelling on a whim, just for the sake of it - 'riding the inspiration'._
須向山陰上小舟。
xū xiàng shān yín shàng xiǎo zhōu
[must] [face] [mountain] [shady side] [on] [small] [boat]
One must, facing the darker side of the mountain, board a small boat
_Instead, Du Fu decides to remain on the quieter side of life, content with simple things._